SUMIF Multi criteria and date range

Detectiveclem

Active Member
Joined
May 31, 2014
Messages
320
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
Hi

The following COUNTIF formula =COUNTIF(Range,"Key*")+COUNTIF(Range,"Potentially*") works perfectly well.

However I want to add a further criteria which allows me to enter a start date in CELL F4 and an end date in CELL H4. I have tried adding the following formula Daterange,">="&$F$4,Daterange,"<="&$H$4 but have been unable to do it correctly. Daterange contains all the dates in one column.

I would be grateful if someone would help me with the correct formula to allow me to obtain a result based on the date range selected.

Thank you
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
could you post a sample sample of your data and desired results so that we can have a look
 
Upvote 0
Hi AlanY, I have tried this but it doesn't work!!! =COUNTIFS(Range,"key*",Range,"Potentially*",Daterange,">="&$F$4,Daterange,"<="&$H$4)

Basically I have about 100k rows of data the column I have called Range contains blanks, or the work starting with Key or the word starting with Potentially. I require the total COUNT of the combined cells containing either of these words. This works perfectly well when I use the formula =COUNTIF(Range,"Key*")+COUNTIF(Range,"Potentially*"), but I now need the ability to only count the cells containing either the words mentioned above based upon if they fall within a date range. The start date in CELL F4 and an end date in CELL H4.

I hope this makes the issue clearer.

Thanks
 
Upvote 0
try this modified version of your original formula

Code:
=COUNTIFS(Range,"key*",Daterange,">="&F4,Daterange,"<="&H4)+COUNTIFS(Range,"Potentially*",Daterange,">="&F4,Daterange,"<="&H4)
 
Upvote 0
Works perfectly, thank you so much. I have been trying for hours but now I see your formula it all makes sense.

Thanks again
 
Upvote 0
Hi, you can also write the formula like this:

Code:
=SUM(COUNTIFS(Range,{"key*","Potentially*"},Daterange,">="&F4,Daterange,"<="&H4))
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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