• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

FILTER ( ) returning #VALUE! error

My formula is in column G. Column L shows the result I am trying to get.

In column G, if you remove the UNIQUE ( ) with the FILTER ( ) within it, and replace that with "", you will have just the XLOOKUP. XLOOKUP would return blanks where project ID = 5 digits. I highlighted these cells in yellow for clarity. I need to tell Excel what to do when column G evaluates to blank. This is where the FILTER ( ) comes in.

Here is what I am trying to do:

For each blank in column G (e.g. 32026), look to the project IDs below it that share the same 5 digit project ID (32026.001 and 32026.003) and return the state abbreviations from column G.

If the same state is returned more than once (e.g. G10:G11), use the UNIQUE ( ) so that only one value is returned, e.g. L9.

If different states are returned (e.g. G13:14), return the word "Multiple," e.g. L12.

The problem is that FILTER is returning #VALUE! inside of UNIQUE( ). And because of that, I can't get as far as using error handling to return "Multiple."

Maybe FILTER isn't the best function to use for this?
 

Attachments

  • Chandoo.org - Filter ( ) returning #VALUE!.xlsx
    12.9 KB · Views: 7
There's no match for this in the Raw Data: 32026DELIVER TO STATE 1

In the Raw Data, you have things like this: 32026001DELIVER TO STATE 1

No match will result in an error.
 
Try this:

=XLOOKUP(F9&G$8,'Raw Data'!$A$2:$A$14,'Raw Data'!$D$2:$D$14,LET(u,UNIQUE(FILTER('Raw Data'!$D$2:$D$14,(NOT(ISNUMBER(--'Raw Data'!$D$2:$D$14))*(LEFT('Raw Data'!$A$2:$A$14,LEN(E9))=E9)))),IF(ROWS(u)=1,u,"Multiple")))
 
Try this:

=XLOOKUP(F9&G$8,'Raw Data'!$A$2:$A$14,'Raw Data'!$D$2:$D$14,LET(u,UNIQUE(FILTER('Raw Data'!$D$2:$D$14,(NOT(ISNUMBER(--'Raw Data'!$D$2:$D$14))*(LEFT('Raw Data'!$A$2:$A$14,LEN(E9))=E9)))),IF(ROWS(u)=1,u,"Multiple")))

Beautiful. That worked. I'm going to have to study that formula.

What is the purpose of the "--" in the ISNUMBER ( )?
 
Last edited:
The double unury — just forces an array to return numbers and not text. Shout if you want a fuller explanation and I’ll provide it tomorrow.
 
Here's a SPILL version:

=MAP(E9:E16,F9:F16,LAMBDA(e,f,XLOOKUP(f&G$8,'Raw Data'!A2:A14,'Raw Data'!D2:D14,LET(u,UNIQUE(FILTER('Raw Data'!D2:D14,(NOT(ISNUMBER(--'Raw Data'!D2:D14))*(LEFT('Raw Data'!A2:A14,LEN(e))=e)))),IF(ROWS(u)=1,u,"Multiple")))))

The attached contains a breakdown of how the original formula works.
 

Attachments

  • DashboardNovice Chandoo.org - Filter ( ) returning #VALUE! SPILL AliGW.xlsx
    15.9 KB · Views: 4
Here's a SPILL version:

=MAP(E9:E16,F9:F16,LAMBDA(e,f,XLOOKUP(f&G$8,'Raw Data'!A2:A14,'Raw Data'!D2:D14,LET(u,UNIQUE(FILTER('Raw Data'!D2:D14,(NOT(ISNUMBER(--'Raw Data'!D2:D14))*(LEFT('Raw Data'!A2:A14,LEN(e))=e)))),IF(ROWS(u)=1,u,"Multiple")))))

The attached contains a breakdown of how the original formula works.

I haven't heard of the MAP ( ). I guess I'll have to look into that. Thank you.
 
Back
Top