SUM COUNTIF Horror

The Grim Discovery

Board Regular
Joined
Jan 23, 2015
Messages
244
Office Version
  1. 365
Platform
  1. Windows
Peoples,

Could someone do a good deed an help me manage this disgrace of a formula into something more succinct?
As you'll see it's calculating the frequency of 'yes' against the frequency of 'yes' and 'no' depending on the condition in B5 is met. It's actually part of a much larger formula containing many similar countifs and it's slowing my worksheet down horribly.

IFERROR(SUM(COUNTIFS(Data!F:F,B5,Data!$K:$K,"yes")+COUNTIFS(Data!F:F,B5,Data!$J:$J,"yes")+COUNTIFS(Data!F:F,B5,Data!$N:$N,"yes/SUM(COUNTIFS(Data!F:F,B5,Data!$K:$K,"no")+COUNTIFS(Data!F:F,B5,Data!$J:$J,"no")+COUNTIFS(Data!F:F,B5,Data!$N:$N,"no")+(Data!F:F,B5,Data!$K:$K,"yes")+COUNTIFS(Data!F:F,B5,Data!$J:$J,"yes")+COUNTIFS(Data!F:F,B5,Data!$N:$N,"yes"))," ")

I've spent several hours trying to make use SUMIF and SUMPRODUCT and frankly have got nowhere.

Thanks in advance
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
First step is to limit your column ranges, get rid of F:F and replace it with something sensible like F1:F1000 depending on how much data you will have.
Same for other column ranges.

This formula is incorrect, no closing quote or bracket yet another SUM begins ?????
And the other section looks wrong too, should this be a COUNTIF or something else
Also looks like you might need another bracket so you're doing a SUM() / SUM, at the moment youre doing
a SUM(.COUNTIF(.. with a / SUM( COUNTIF..)), doesnt look at all right.

Please correct so we know EXACTLY what the formula is.

IFERROR(SUM(COUNTIFS(Data!F:F,B5,Data!$K:$K,"yes")+COUNTIFS(Data!F:F,B5,Data!$J:$J,"yes")+COUNTIFS(Data!F:F,B5,Data!$N:$N,"yes/SUM(COUNTIFS(Data!F:F,B5,Data!$K:$K,"no")+COUNTIFS(Data!F:F,B5,Data!$J:$J,"no")+COUNTIFS(Data!F:F,B5,Data!$N:$N,"no")+(Data!F:F,B5,Data!$K:$K,"yes")+COUNTIFS(Data!F:F,B5,Data!$J:$J,"yes")+COUNTIFS(Data!F:F,B5,Data!$N:$N,"yes"))," ")
 
Last edited:
Upvote 0
SUMIF or SUMPRODUCT are the "old" ways of doing PIvot Table analysis. Yes sometimes a regular Pivot Table can't do what you need... but Power Pivot can!
SUMPRODUCT is often used in an ARRAY (CSE) version which may be another complication for the execution of your formula.

The semi-brutish way would be VBA to do the calculation you need and past the value. It loads the workbook down when running the macro, but once calculated any subsequent CALCULATE Worksheet/Workbook won't have that formula to trudge thru.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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