Blank Values in FILTER function results

New Contributor

I'm running a FILTER function to create the input data for a Word mail merge document. What value do I test for in the mail merge for a blank cell returned by the FILTER function?


If I add two fields into the mail merge document and one of them is blank in the source data the mail merge field displays a zero. If I do a conditional test (IF THEN ELSE) in the mail merge on the source data using blank (" ") or zero as the test, neither find the blank value. I'm assuming that, behind the scenes, Excel is populating a "blank" cell result from a FILTER function as some special character or value (not blank or zero) and I just need to test for that. 


If I run the mail merge on the original (pre-FILTER) data it picks up the blank values correctly so I assume it's something about the way data is treated when processed by the FILTER function.


Anyone any ideas?




4 Replies


FILTER() returns blanks as zero.

Thanks Sergei,

It certainly appears to. When I print the value in mail merge it prints as zero. My issue is that if I test for the zero value in a conditional IF THEN ELSE it doesn't appear to recognise it as zero.
This doesn't preclude the possibility that I'm just doing it wrong...



It sounds as if you're doing the IF THEN ELSE conditional test in Word. Which is fine; I've done the same on occasion. What I'm wondering is whether you could just (in Excel) change the values in those added cells--if I understood you again--to "Y" or "N" or something other than blank/zero. Since the value per se isn't apparently of significance in itself--not a part of an amount that needs to be calculated or some such--but is used to direct a custom sentence or paragraph--making it unmistakably "Y" or "N" might be an appropriate work-around.

Thanks mathetes,

I am indeed doing the conditional test in Word. Yours is a good idea unfortunately the fields are payee (from a list) in one field and the other field is other payee (free format, if the payee isn't on the list). There will only be one value so the test is IF there is a payee don't print the Other Payee field, so one field or the other must be blank. I've actually solved my immediate problem by using a more thoughtful boolean test but I thought I'd try to understand the underlying problem.

I think it'll be an issue between Excel and a fairly old bit of Word but I thought I'd start in this group to see if anyone has come across it.