COUNTIFs giving SPILL Error

dfelock

New Member
Joined
Dec 16, 2010
Messages
11
Hello All,

I'm having an issue with COUNTIFS. Here's my situation. I'm building an attendance tracker and I have all of my reports listed as well as the work week:
1665667251641.png

I currently have a COUNTIF formula: COUNTIF(DC$17,"X")+COUNTIF(DC$18,"X")+COUNTIF(DC$19,"X")+COUNTIF(DC$10,"X")+COUNTIF(DC$11,"X"). I use this with a lower section that lets me know if I have all my work stations covered for the day. Now though, as per the picture, when I try to turn it into a COUNTIFS(DC$5,@{"X","WFH"},DC$9,@{"X","WFH"},DC$11,@{"X","WFH"},DC$14,@{"X","WFH"}) I'm getting a SPILL error. Any ideas?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
If you use an array for the criteria, you will get an array of results, not just one.

Out of interest, what do you think that formula is doing?
 
Upvote 0
If you use an array for the criteria, you will get an array of results, not just one.

Out of interest, what do you think that formula is doing?
So here is my thought process:
The COUNTIFS will count if each cell contains either "X" or "WFH"
1665671870256.png

Above is a screenshot of the cells that I have and then lower section that adds it all up, or is supposed to. Below is the original formula before adding in the WFH part.
="ET02: " & COUNTIF(DD$10,"X")+COUNTIF(DD$8,"X")+COUNTIF(DD$11,"X")+COUNTIF(DD$6,"X")+COUNTIF(DD$14,"X")

Dan
 

Attachments

  • 1665671667053.png
    1665671667053.png
    1.7 KB · Views: 5
Upvote 0
That's what I suspected, but is not what that formula does. It will return an array of two values, each of them will be 1 if all the cells contain "X" or if all the cells contain "WFH", but 0 for any other combination. I think you want:
Excel Formula:
="ET02: " & SUM(COUNTIF(DD$10,{"X","WFH"}),COUNTIF(DD$8,{"X","WFH"}),COUNTIF(DD$11,{"X","WFH"}),COUNTIF(DD$6,{"X","WFH"}),COUNTIF(DD$14,{"X","WFH"}))
 
Upvote 0
Solution
That's what I suspected, but is not what that formula does. It will return an array of two values, each of them will be 1 if all the cells contain "X" or if all the cells contain "WFH", but 0 for any other combination. I think you want:
Excel Formula:
="ET02: " & SUM(COUNTIF(DD$10,{"X","WFH"}),COUNTIF(DD$8,{"X","WFH"}),COUNTIF(DD$11,{"X","WFH"}),COUNTIF(DD$6,{"X","WFH"}),COUNTIF(DD$14,{"X","WFH"}))
You are amazing!!! Thank you! Worked perfectly.
 
Upvote 0
Glad we could help. :)
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,692
Members
449,117
Latest member
Aaagu

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