Removed Blanks in Data Validation - Office 365

smitpau

Board Regular
Joined
Apr 2, 2020
Messages
167
Office Version
  1. 365
Platform
  1. Windows
Hi,

As the title says I'd like to remove blanks in a data validation list, I've followed the article below but the way Office 365 works is after effectively changing the formula below it expands out the cell for the full list, this means when I reference the cell in name manager the cells are constantly changing instead of being in a single cell.

Does anybody have any ideas how to stop the list spilling down into the cells below as I believe it should then work.

Thanks for reading!

=Sheet1!$C$2:INDEX(Sheet1!$C$2:$C$1000,SUMPRODUCT(--(Sheet1!$C$2:$C$1000<>"")))

 
Last edited:

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I didn't read the whole article but it looks like a complicated way to perform a simple task.
This assumes no header in C1, if there is then the validation formula will need changing to =OFFSET($C$2,,,ROWS($C:$C)-COUNTIF($C:$C,"")-1)
Book1 (version 1).xlsb
ABCDE
1
2ChamomileChamomileChamomile
3LavenderLavender
4Liquorice
5LiquoriceChai
6Ginger
7ChaiOolong
8Ginger 
9Oolong 
Sheet3
Cell Formulas
RangeFormula
C2:C9C2=IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW(A$2:A$9)/SIGN(LEN(A$2:A$9)),ROWS(C$2:C2))),"")
Cells with Data Validation
CellAllowCriteria
E2List=OFFSET($C$2,,,ROWS($C:$C)-COUNTIF($C:$C,""))
 
Upvote 0
I believe that you have the FILTER function so isn't this what you want? (If not please give us a small set of sample dummy data with XL2BB & explain in relation to that)

smitpau 2020-05-19 1.xlsm
ABCDE
1Full DataNo BlanksData Validation Cell(s)
2ChamomileChamomileChai
3LavenderLavenderOolong
4Liquorice
5LiquoriceChai
6Ginger
7ChaiOolong
8Ginger
9Oolong
10
Sheet1
Cell Formulas
RangeFormula
C2:C7C2=FILTER(A2:A1000,A2:A1000<>"")
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
E2:E3List=C$2#
 
Upvote 0
Thanks very much both, much appreciated.

It's that # at the end of the data validation that's done the trick.
 
Upvote 0
Haha fair point I mentally ignored that as thought it wouldn't help given those rows were fixed as there was only ever going to be 3 of them, but see it doesn't matter now it basically takes a dynamic array of x length into a single cell which is useful.
 
Upvote 0
Yes the # indicates that the cell reference is the first cell in a 'spill range' and Excel then knows to use the full spill range no matter how many rows it contains.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,184
Members
452,615
Latest member
bogeys2birdies

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