SOLVED

When FILTER is used in an IF statement only 255 characters can be returned else #Value! error

%3CLINGO-SUB%20id%3D%22lingo-sub-2439303%22%20slang%3D%22en-US%22%3EWhen%20FILTER%20is%20used%20in%20an%20IF%20statement%20only%20255%20characters%20can%20be%20returned%20else%20%23Value!%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2439303%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20having%20an%20issue%20trying%20to%20return%20the%20results%20of%20a%20filter%20without%20%220%22s%2C%20because%20the%20value%200%20actually%20means%20something%20in%20the%20data%20I%20am%20filtering.%3CBR%20%2F%3E%3CBR%20%2F%3ETo%20get%20around%20this%20I%20tried%20the%20following%3CBR%20%2F%3E%3CBR%20%2F%3E%3DIF(ISBLANK(FILTER(DataSheet!%24A%242%3A%24V%245000%2CDataSheet1!%24A%242%3A%24A%245000%3DThisSheet!%24C%243))%2C%22%22%2CFILTER(DataSheet!%24A%242%3A%24V%245000%2CDataSheet!%24A%242%3A%24A%245000%3DThisSheet!%24C%243))%3CBR%20%2F%3E%3CBR%20%2F%3EBut%20for%20any%20of%20the%20cells%20that%20have%20over%20255%20characters%20in%20DataSheet%20the%20above%20returns%20%23Value!%20error%3CBR%20%2F%3E%3CBR%20%2F%3EAny%20help%20for%20resolving%20the%20error%20or%20for%20displaying%20Filter%20results%20with%200%20the%20character%20being%20kept%20but%20a%20null%20cell%20being%20represented%20by%20null%20or%20an%20empty%20string%20%22%22%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2439303%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2440271%22%20slang%3D%22en-US%22%3ERe%3A%20When%20FILTER%20is%20used%20in%20an%20IF%20statement%20only%20255%20characters%20can%20be%20returned%20else%20%23Value!%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2440271%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F731731%22%20target%3D%22_blank%22%3E%40Paul_Mountford%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENo%20one%20formula%20in%20Excel%20could%20return%20blank%20value%2C%20thus%20ISBALNK(FILTER())%20doesn't%20work%2C%20it's%20always%20FALSE.%20I%20guess%20the%20question%20is%20if%20C3%20is%20blank.%20You%20may%20try%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3EFILTER(DataSheet!%24A%242%3A%24V%245000%2C%0A%20%20(DataSheet!%24A%242%3A%24A%245000%3DThisSheet!%24C%243)%20*%0A%20%20(DataSheet!%24A%242%3A%24A%245000%20%26lt%3B%26gt%3B%20%22%22)%0A)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Eto%20exclude%20blanks%20from%20filtering.%20However%2C%20not%20sure%20which%20logic%20you'd%20kike%20to%20apply.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2443924%22%20slang%3D%22en-US%22%3ERe%3A%20When%20FILTER%20is%20used%20in%20an%20IF%20statement%20only%20255%20characters%20can%20be%20returned%20else%20%23Value!%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2443924%22%20slang%3D%22en-US%22%3EThanks%20but%20the%20code%20you've%20presented%20just%20returns%20the%20whole%20table.%3CBR%20%2F%3E%3CBR%20%2F%3EIt's%20a%20bit%20of%20a%20hack%20but%20you%20can%20execute%20the%20formula%20FILTER(DataSheet!...%20%2C%20DataSheet!%20%3D%20C3)%20and%20after%20the%20values%20are%20on%20the%20spreadsheet%20you%20can%20put%20ISBLANK()%20around%20the%20formula%20which%20will%20then%20display%20the%20true%20and%20false%20values%2C%20which%20is%20how%20you%20can%20get%20my%20original%20code%20to%20either%20display%20the%20text%20or%20the%20%22%22%2C%20but%20in%20cells%20with%20over%20255%20characters%20it%20returns%20%23Value!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2444244%22%20slang%3D%22en-US%22%3ERe%3A%20When%20FILTER%20is%20used%20in%20an%20IF%20statement%20only%20255%20characters%20can%20be%20returned%20else%20%23Value!%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2444244%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F731731%22%20target%3D%22_blank%22%3E%40Paul_Mountford%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20see%2C%20that's%20interesting.%20I%20guess%20that's%20the%20limitation%20of%20any%20if()%20function%20-%20IF()%2C%20COUNTIF()%2C%20etc.%20They%20don't%20work%20with%20constants%20more%20than%20255%20characters%2C%20and%20in%20your%20case%20before%20array%20converted%20to%20range%20this%20limitation%20works.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EVariant%2C%20if%20you%20work%20with%20texts%2C%20could%20be%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DLET(str%2CFILTER(DataSheet!%24A%242%3A%24V%245000%2CDataSheet!%24A%242%3A%24A%245000%3DThisSheet!%24C%243)%2C%20LEFT(str%2C1500)%20)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EIt%20there%20are%20numbers%20within%20the%20range%20they%20will%20be%20returned%20as%20texts.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2444385%22%20slang%3D%22de-DE%22%3ERe%3A%20When%20FILTER%20is%20used%20in%20an%20IF%20statement%20only%20255%20characters%20can%20be%20returned%20else%20%23Value!%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2444385%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eso%20far%20i%20know%20(shouldn't%20mean%20much%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%20%20in%20all%20Formulas%20we%20can%20insert%201024%20charakters.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EDid%20I%20get%20something%20wrong%3F%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3E(which%20is%20the%20case%20now%20and%20then%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Foffice%2Fexcel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3%3Fui%3Den-US%26amp%3Brs%3Den-US%26amp%3Bad%3DUS%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EExcel%20specifications%20and%20limits%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThx%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I'm having an issue trying to return the results of a filter without "0"s, because the value 0 actually means something in the data I am filtering.

To get around this I tried the following

=IF(ISBLANK(FILTER(DataSheet!$A$2:$V$5000,DataSheet1!$A$2:$A$5000=ThisSheet!$C$3)),"",FILTER(DataSheet!$A$2:$V$5000,DataSheet!$A$2:$A$5000=ThisSheet!$C$3))

But for any of the cells that have over 255 characters in DataSheet the above returns #Value! error

Any help for resolving the error or for displaying Filter results with 0 the character being kept but a null cell being represented by null or an empty string ""

9 Replies

@Paul_Mountford 

No one formula in Excel could return blank value, thus ISBALNK(FILTER()) doesn't work, it's always FALSE. I guess the question is if C3 is blank. You may try

FILTER(DataSheet!$A$2:$V$5000,
  (DataSheet!$A$2:$A$5000=ThisSheet!$C$3) *
  (DataSheet!$A$2:$A$5000 <> "")
)

to exclude blanks from filtering. However, not sure which logic you'd kike to apply.

Thanks but the code you've presented just returns the whole table.

It's a bit of a hack but you can execute the formula FILTER(DataSheet!... , DataSheet! = C3) and after the values are on the spreadsheet you can put ISBLANK() around the formula which will then display the true and false values, which is how you can get my original code to either display the text or the "", but in cells with over 255 characters it returns #Value!
best response confirmed by Paul_Mountford (New Contributor)
Solution

@Paul_Mountford 

I see, that's interesting. I guess that's the limitation of any if() function - IF(), COUNTIF(), etc. They don't work with constants more than 255 characters, and in your case before array converted to range this limitation works.

 

Variant, if you work with texts, could be

=LET(str,FILTER(DataSheet!$A$2:$V$5000,DataSheet!$A$2:$A$5000=ThisSheet!$C$3), LEFT(str,1500) )

It there are numbers within the range they will be returned as texts.

@Sergei Baklan 

so far i know (shouldn't mean much in all Formulas we can insert 1024 charakters.

Did I get something wrong? (which is the case now and then

 

Excel specifications and limits

 

Thx

@NikolinoDE 

Not exactly, we spear about variables, not about texts in grid. You may try

=IF(0, "a", "bbbbbbbbbb")

As soon as you repeat "b" in third parameter more than 255 times, you have an error

image.png

Practically is the same with COUNTIF() with long condition text, the only you have an error without explanations about contrition text length.

Same will be if simply ="bbbbb" if in above "b" is repeated more than 255 times. However,

=IF(0,A1,B1)
if in B1 is a long text, or
=IF(0, "a", REPT("b", 700) )

work.

Same with array formulas, before you convert array elements into grid range limit on variables will be applied.

Thanks, appreciate the explanation as well as the workaround.

@Paul_Mountford , you are welcome and thank you for interesting case