SUM of COUNTIFS with OR logic Error

bisho

Board Regular
Joined
Apr 21, 2012
Messages
85
Hi,

I'm trying to change the criteria between the brackets {} in A42 formula to have the cell reference C2, C3 & C4 instead of using the text in these 3 cells (=SUM(COUNTIFS(A8:A39,{C2,C3,C4}))) but I keep getting this error.
Isn't allowed to use cell references in this scenario?

Thanks,

1714510413788.png




Room Attendant Schedule 2024.xlsx
ABC
1SundayShifts
228-Apr8AM-4:30PM
344.00%9AM-5:30PM
412910AM-6:30PM
5484PM-10PM
653R/OFF
7OFF
8OFFON CALL
9ON CALL
10OFF
118AM-4:30PM
12OFF
1310AM-6:30PM
14OFF
159AM-5:30PM
16OFF
17R/OFF
1810AM-6:30PM
198AM-4:30PM
2010AM-6:30PM
21R/OFF
2210AM-6:30PM
2310AM-6:30PM
24R/OFF
258AM-4:30PM
264PM-10PM
2710AM-6:30PM
288AM-4:30PM
2910AM-6:30PM
309AM-5:30PM
31R/OFF
32ON CALL
33ON CALL
3410AM-6:30PM
354PM-10PM
3610AM-6:30PM
379AM-5:30PM
3810AM-6:30PM
39OFF
40
41
4217
4.28.2024-5.4.2024
Cell Formulas
RangeFormula
A1A1=TEXT(A2,"dddd")
A42A42=SUM(COUNTIFS(A8:A39,{"8AM-4:30PM","9AM-5:30PM","10AM-6:30PM"}))
Cells with Data Validation
CellAllowCriteria
A8:A39List=$C$2:$C$8
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Hello - if these times are fixed ie,
8AM-4:30PM
9AM-5:30PM
10AM-6:30PM

You could list these 3 dates and set these up under a helper column and then enter the formula;

=SUM(COUNTIFS(A:A Being Criteria Text Range, Then Range Above Being Criteria (Say C1:C3)

Once you start to add more of the above dates to the text range, this should update the count.

Hopefully this works for you.






 
Upvote 0
Don't put the cells inside {} just use
Excel Formula:
=SUM(COUNTIFS(A8:A39,C2:C4))
 
Upvote 0
Solution
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
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