Counting Values in a List

Orbit

New Member
Joined
May 18, 2014
Messages
24
Hey everyone,

I am trying to a multiple criteria countifs, but I need the last one to countif the value is one of several things.

Ex.:

=COUNTIFS($D:$D,">="&H2,'!$D:$D,"<="&H3,$B:$B,{"Green","Blue","Red","Yellow"})

H2 and H3 in this example would be a date range, as column D is a list of dates. Column B would be a list of colors that contain more than just the four above, but I would only want to count them in the row falls between the date range, and the color is on of those colors. I have search the forums and haven't found anything that has given me my answer yet.

Any help is appreciated, thank you in advance.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Just put a SUM around it:

=SUM(COUNTIFS($D:$D,">="&H2,$D:$D,"<="&H3,$B:$B,{"Green","Blue","Red","Yellow"}))

When entering the array of colors, Excel returns an internal array of the results for each individual color. You can add the SUM to get the total. If you don't, you'll just see the first result.

Also, I removed '! in one spot which I assume is the remnants of a sheet name.
 
Last edited:
Upvote 0
Worked perfect. The sad thing is, that I think somewhere in my head I already knew to do that, but for the life of me I could not remember how to do it. Just needed that one final step.

Thanks for the help.
 
Upvote 0
You're welcome.

Don't feel bad about the memory slippage. I'm at the stage of life where every time I learn something new, something else slips out! (Except that darn Gilligan's Island theme. I think that's in there forever!)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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