adding countifs, both with multiple values possible

larryvoorhees

New Member
Joined
Aug 14, 2017
Messages
7
I'm building an Absence Calendar, and attempting to accumulate the number of "occurrences" for each individual.
Each agent has two rows. Top row is blank, or has the value "UP","T" or "LE" in it. Second row for each agent is either blank, or has a numeric value from 0 - 8 (number of hours gone) in it.
I want to accumulate in the following manner: If Row 1 is "UP", "T" or "LE" and bottom row is a value of 2 or greater, count 1. If Row 1 is "UP", "T", or "LE", and bottom row is >=.25 and <2, count .5.
I just can't seem to get it right without double-counting.
Here is the formula I have so far, but I know it's not correct:
=(COUNTIFS(C94:AG94,{"UP";"T";"LE"},C95:AG95,">2")+(COUNTIFS(C94:AG94,{"UP";"T";"LE"},C95:AG95,">=0.25",C95:AG95,"<=2")*0.5))

With the formula above, I don't believe it's counting the items as "OR", as in "if the value is UP or T or LE" AND >2, etc.

Any help anyone can provide would be greatly appreciated. This has killed way too many hours and brain cells already! Thanks!
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
=SUMPRODUCT(COUNTIFS(C94:AG94,{"UP";"T";"LE"},C95:AG95,">2")+(COUNTIFS(C94:AG94,{"UP";"T";"LE"},C95:AG95,">=0.25",C95:AG95,"<=2")*0.5))

worked like a charm. Thank you!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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