Sumproduct returning FALSE for TRUE values?

uceaamh

New Member
Joined
Feb 23, 2017
Messages
27
Hello,

I'm struggling to get a SUMPRODUCT formula to work.
=IF(SUMPRODUCT((Table4[Premises - ID]=$A3)*1,(Table4[Notice Type]="PIN")*1)=1,"Y","N")

Here is the issue:

In the worksheet with the formula A3 = 59438. So, I'm looking for a 59438 in a separate worksheet, holding Table 4, under the "Premises - ID" Header.

There is a 59438 in Table 4, under "Premises - ID". There are 5 of them actually. When I highlight
Table4[Premises - ID]
in the formula and hit F9, I get the following string:
{"57052";"58828";"59438";"59234";"152614";"26724";"55659";"55354";"28320";"152622";"54905";"55081";"26567";"28043";"55211";"59168";"58882";"20498";...
(excerpted to save room). As you can see, 59438 is the third number to appear in the string.

BUT when I highlight
Table4[Premises - ID]=$A3
in the string and hit F9, I get a long row of:
{FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;...

I'm not sure what is going on here? Shouldn't the matching 59438 return as TRUE?

This problem doesn't seem to be occurring in the second array, where
Table4[Notice Type]="PIN"
returns an appropriate blend of TRUE;FALSE

Thanks in advance!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
You're right. Thanks for that.

That goal is to tell the user whether a premises ID # has an attached notice type, in this case "PIN". This formula is repeated for the other notice types that can be attached in other cells.
 
Upvote 0
To avoid such problem, you can modify your formula as follows:

=IF(SUMPRODUCT((Table4[Premises - ID]-$A3=0)*1,(Table4[Notice Type]="PIN")*1)=1,"Y","N")
 
Upvote 0
You're right. Thanks for that.

That goal is to tell the user whether a premises ID # has an attached notice type, in this case "PIN". This formula is repeated for the other notice types that can be attached in other cells.

If you don't want to coerce the text number IDs into true number IDs, use $A3&"" in the formulas in what follows.

Assuming that an ID has always 1 notice type, not many:

=IFERROR(IF(VLOOKUP(A3,CHOOSE({1,2},Table4[Premises - ID],Table4[Notice Type]),2,0)="PIN","Y","N"),"not available")

A bit succinctly expressed...

=IFERROR((VLOOKUP($A3,CHOOSE({1,2},Table4[Premises - ID],Table4[Notice Type]),2,0)="PIN")+0,"not available")

where a 1 means a hit (yes), a 0 miss (no).

If an ID can be associated with multiple notice types:

In C3 control+shift+enter, not just enter:

=ISNUMBER(MATCH($A3,IF(Table4[Notice Type]="PIN",Table4[Premises - ID]),0))+0
 
Upvote 0
Hi!

Try this too:

=IF(COUNTIFS(Table4[Notice Type],"PIN",Table4[Premises - ID],$A3),"Y","N")

Markmzz

That got it.

Thanks, @Aladin Akyurek and @shaowu459 for the suggestions as well, but I couldn't get the formulas to return properly. I kept just getting 0's - even after converting everything to numbers manually.
 
Last edited:
Upvote 0
@ uceaamh

Aladin Akyurek... I kept just getting 0's - even after converting everything to numbers manually.

Now you might get into trouble with other types of processing...

As I said, you might use $A3&"" if you didn't succeed with conversion.
 
Upvote 0

Forum statistics

Threads
1,214,556
Messages
6,120,190
Members
448,949
Latest member
keycalinc

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