简体   繁体   中英

Skipping Rows with certain value in formula

iam trying to create a COLUMN using array from another sheet of same workbook that omit cell with empty value like shown in column C which is I required

column A   Column B   Column C
 A            15        A
 B            10        B
 C            BLANK     D
 D            7         F
 E            BLANK     
 F            11    

I tried this code for got error #NUM

=IFERROR(INDEX('DATE WISE CONSUMPTION'!B$30:B$87,SMALL(IF('DATE WISE CONSUMPTION'!G$30:G$87<>"",ROW('DATE WISE CONSUMPTION'!B$30:B$87)-ROW('DATE WISE CONSUMPTION'!B$30)+1),ROWS(D$30:D31))),"")        

A 'list-unique-with-conditions' array formula requires a single cell above the first cell with the formula in order to avoid circular references.

In an unused cell to the right as an array formula¹,

=IFERROR(INDEX('DATE WISE CONSUMPTION'!B$30:B$87, MATCH(0, IF(LEN('DATE WISE CONSUMPTION'!G$30:G$87), COUNTIF('DATE WISE CONSUMPTION'!J$29:J29, 'DATE WISE CONSUMPTION'!B$30:B$87&""), 1), 0)), "")

Fill down as necessary.

data_wise_consumption

Your formula would have worked as an array formula finalized with CSE and this slight modification,

=IFERROR(INDEX('DATE WISE CONSUMPTION'!B$30:B$87,SMALL(IF('DATE WISE CONSUMPTION'!G$30:G$87<>"",ROW('DATE WISE CONSUMPTION'!B$30:B$87)-ROW('DATE WISE CONSUMPTION'!B$30)+1),ROW(1:1))),"")

You were starting off with ROWS(D$30:D31) which resolves to 2 not 1 so the SMALL function was returning the second match to start off with, not the first.


¹ Array formulas need to be finalized with Ctrl + Shift + Enter↵ . If entered correctly, Excel with wrap the formula in braces (eg { and } ). You do not type the braces in yourself. Once entered into the first cell correctly, they can be filled or copied down or right just like any other formula. Try and reduce your full-column references to ranges more closely representing the extents of your actual data. Array formulas chew up calculation cycles logarithmically so it is good practise to narrow the referenced ranges to a minimum. See Guidelines and examples of array formulas for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM