SUMPRODUCT - NON-CONTIGUOUS problem

The Grim Discovery

Board Regular
Joined
Jan 23, 2015
Messages
246
Office Version
  1. 365
Platform
  1. Windows
Hiya

Could anyone advise me on how best to adjust the following formula? It works fine for calculating the % of 'Yes' /'Yes'+'No' across the range J2:AB500. However, I do not wish to include columns H, L, P and T from within this range. What's making this difficult is that columns H, L, P and T also contain a load of 'yes's and 'no's.

Here's the formula:

=SUMPRODUCT(ISNUMBER(MATCH(Data!$F$2:$F$500,{"Blue,"Red","White"},0))*ISNUMBER(MATCH(Data!J2:AB500,{"YES"},0)))/SUMPRODUCT(ISNUMBER(MATCH(Data!$F$2:$F$500,{"Blue","Red","White"},0))*ISNUMBER(MATCH(Data!J2:AB500,{"YES","NO"},0)))

Thanks in advance.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
It looks like Column H is already excluded from J2:AB500, so we only need to exclude Columns L, P, and T. Therefore, try the following formula, which needs to be confirmed with CONTROL+SHIFT+ENTER...

Code:
=SUM(IF(ISNUMBER(MATCH(Data!F2:F500,{"Blue","Red","White"},0)),IF(ISNA(MATCH(COLUMN(Data!J2:AB500),{12,16,20},0)),IF(Data!J2:AB500="YES",1))))/SUM(IF(ISNUMBER(MATCH(Data!F2:F500,{"Blue","Red","White"},0)),IF(ISNA(MATCH(COLUMN(Data!J2:AB500),{12,16,20},0)),IF(ISNUMBER(MATCH(Data!J2:AB500,{"YES","NO"},0)),1))))

Actually, for robustness, try the following formula instead...

Code:
=SUM(IF(ISNUMBER(MATCH(Data!F2:F500,{"Blue","Red","White"},0)),IF(ISNA(MATCH(COLUMN(Data!J2:AB500)-COLUMN(Data!J2)+1,{3,7,11},0)),IF(Data!J2:AB500="YES",1))))/SUM(IF(ISNUMBER(MATCH(Data!F2:F500,{"Blue","Red","White"},0)),IF(ISNA(MATCH(COLUMN(Data!J2:AB500)-COLUMN(Data!J2)+1,{3,7,11},0)),IF(ISNUMBER(MATCH(Data!J2:AB500,{"YES","NO"},0)),1))))

Note that the formula also needs to be confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!
 
Upvote 0
Hey Domenic

That is just brilliant - just what I was after. Thank you so very much indeed.
All the best.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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