IF AND & COUNTIF Problem

N3cTr0

New Member
Joined
Jan 6, 2022
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Good Day,

I'm trying to get this formula to work where it searches completed dates within a range of dates then if the value is true runs a countif to check how many customers are within that range.
Any assistance would be appreciated.
Example below:

Book1
ABCDEFG
1Completed DateCustomer Code
21/25/2022CLICKZGRP
35/7/2022CASHBZGRPDate Ranges
411/5/2022CLICKZGRP1/1/202231/1/2022
52/23/2022SRITEZGRP
65/7/2022CLICKZGRPCompleted SitesExpected Values
74/7/2022SRITEZGRPCLICKZGRP01
8SRITEZGRPCASHBZGRP00
9PNPZGRPSRITEZGRP00
101/25/2022PNPZGRPPNPZGRP01
11SPECIZGRPSPECIZGRP01
121/12/2022SPECIZGRP
Sheet1
Cell Formulas
RangeFormula
E7:E11E7=IF(AND(A:A>$D$4,A:A<E4),COUNTIF(B:B,D7),0)
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Perhaps this:

=COUNTIFS($A$2:$A$12,">="&$D$4,$A$2:$A$12,"<="&$E$4,$B$2:$B$12,$D7)

I had to normalize the dates to work for me, but after that it produced the results as your expected values.
 
Upvote 1
Solution
Thank you kindly, just realized my 1 date was off that i was comparing against thx m and your formula works perfectly:)
 
Upvote 0

Forum statistics

Threads
1,214,897
Messages
6,122,151
Members
449,068
Latest member
shiz11713

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