Dynamic Range to not include Blank Values (even if cell has formula)

justanotheruser

Board Regular
Joined
Aug 14, 2010
Messages
96
Hi guys,

I've got this table below whereby row C contains data inputted by a user and there could be duplicate entries, so I've got formulas in Column A and B that remove the duplicate entries, as you can see:


Excel Workbook
ABCD
1EntityAdditional Sheets to open
2
31FA6_210FA6_210PL_Workwear
41FA7_220FA6_210BS_Workwear
51FA8S_220FA6_210PL_Cleanroom
62FA89_230FA7_220PL_Workwear
73KK_230FA8S_220BS_Workwear
84210FA89_230PL_Cleanroom
95 KK_230PL_Workwear
105 KK_230BS_Workwear
116 210
127 
138 
Mapping


The problem I have is that I am trying to use the contents of Column B in a dynamic drop down list, where there should be no blanks:


If we look at Column B, where I have defined a name, called ENTA with the following: =OFFSET(Mapping!$B$3,0,0,COUNTA(Mapping!$B:$B),1) - in cell B10, even though the cell value is blank, because there is a formula in it, the cell is chosen as part of the dynamic range - is there a way to adjust the offset formula to fix this? The cells in Column B are formatted as [=0]"";General

Thanks! :)
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
I've been googling and I can only see examples where there is no data whatsoever in a cell - i.e. no formula either will Excel recognise it as blank. Alternatively, if I remove the formatting of the cells in column B, the blank will show up as a 0 value - would something magical be able to be done with that? Thanks again! :)
 
Upvote 0
This array formula in B3 (and copied down to B13) will return unique entries from column C. No need for column A in this case.

B3
Code:
=IF(ISNA(INDEX($C$3:$C$13, MATCH(0, COUNTIF($B$2:B2, $C$3:$C$13), 0))), "", INDEX($C$3:$C$13, MATCH(0, COUNTIF($B$2:B2, $C$3:$C$13), 0)))

The last result in the column B unique list will be 0
This ENTA Dynamic Named Range formula will look for that zero to determine the count of unique entries and not include the zero or blanks cells at the bottom of the list.

ENTA
Code:
=OFFSET(Mapping!$B$3,0,0,MATCH(0,Mapping!$B$3:$B$13,0)-1)


You could shorten the B3 formula to this if you don't care if the #N/A error is displayed in cells in column B. It would not affect the ENTA formula
Code:
=INDEX($C$3:$C$13, MATCH(0, COUNTIF($B$2:B2, $C$3:$C$13), 0))
 
Last edited:
Upvote 0
Thanks for your response. My sheet now looks like this:

Excel Workbook
ABCD
1EntityAdditional Sheets to open
2
3Select EntitySelect Entity
4FA6_210FA6_210BS_Workwear
5FA7_220FA6_210PL_Cleanroom
6FA8S_220FA7_220PL_Workwear
7FA89_230FA8S_220BS_Workwear
8KK_230FA89_230PL_Cleanroom
9210KK_230PL_Workwear
10230KK_230BS_Workwear
110210
12 230
13 
Mapping


And in Name Manage, Name is ENTA, and Refers to is =OFFSET(Mapping!$B$3,0,0,MATCH(0,Mapping!IT1:IT11,0)-1)

However, if I type "ENTA" without the "" in the name box to show the range, nothing happens. Also, is it possible to make the code dynamic for the countif $C$3:$C$13 or just extent it significantly as there will probably be around 100 rows for the column C.

Thanks again! :)
 
Upvote 0
This should be the ENTA formula
Code:
=OFFSET(Mapping!$B$3,0,0,MATCH(0,Mapping!$B$3:$B$13,0)-1)

This should be the Data Validation formula
=ENTA

You can make C3:C13 (And $B3:$B$13 in the ENTA formula) to include more rows than you need e.g. C3:C500
 
Upvote 0

Forum statistics

Threads
1,215,427
Messages
6,124,830
Members
449,190
Latest member
rscraig11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top