Help with COUNTIF / OR formula and SUMIF / OR formula

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
886
Office Version
  1. 365
Platform
  1. Windows
I need help with a formula or possibly another way to figuring out this problem:

I want to count everything in 'WO Report'!$Y:$Y that states: TRUE

Only IF

'WO Report'!B:B Matches List!B2

However only if there is no match between 'WO Report'!B:B and List!B2

I want to count everything in 'WO Report'!$Y:$Y that states: TRUE

IF

'WO Report'!Z:Z, Matches List!B2

So basically toggling between: =COUNTIFS('WO Report'!$Y:$Y,TRUE,'WO Report'!B:B,List!B2 OR 'WO Report'!$Y:$Y,TRUE,'WO Report'!Z:Z,List!B2)

Is there a way to do this?

I will also require the same with a SUMIF but it will reference different columns.


Note: I am using a combo box that has a link to B2, however when the combo box is selected to ALL, I want the formula to count everything but there is no match to "ALL", so what I did was added a column (WO Report'!Z:Z) that just has the word "ALL" all the way down and would have the formula count that if Column Y:Y is TRUE. I have no idea if this is even possible but hope someone can help.

Thank you very much!

Carla
 
Last edited:

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
This formula seems to be working:

COUNTIFS('WO Report'!$Y:$Y,TRUE,'WO Report'!B:B,List!B2)+(COUNTIFS('WO Report'!$Y:$Y,TRUE,'WO Report'!Z:Z,List!B2))

Let me know if I am on the right track?

Thank you everyone! :)
 
Upvote 0
Definitely on the right track. However, one question: will the List!B2 value be in column B OR column Z? Is there a chance it could be in both? If so, you'll end up double counting some rows. Your second COUNTIFS has some unneeded parentheses too, but they don't hurt anything.
 
Upvote 0
Column B and Column Z will never have the same values.

Column B is 255 customer names and Column Z is the word "ALL" repeated for all data.

So if the formula doesn't find a match for column B it will for Z and vice versa but never for both.

Always appreciate info on how to make a formula more efficient though, I still have a lot to learn :)

Thank you! :)
 
Upvote 0

Forum statistics

Threads
1,214,411
Messages
6,119,360
Members
448,888
Latest member
Arle8907

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