Counting the number of items between two dates

ihmunro

Board Regular
Joined
Oct 11, 2002
Messages
74
Morning

I have been working with SUMPRODUCT which works well and I am not sure if this is what I need to use.

I am trying to identify the number of line items that have dates between today and 30 days, 30 - 90 days and > 90 days.

I am trying to do as a lookup.

Many thanks in advance.

Iain
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Damon Ostrander

MrExcel MVP
Joined
Feb 17, 2002
Messages
4,239
Hi Iain,

I'm not sure whether you are referring to dates 30-90 days in the future, or the past. Assuming the future, you could use the following to obtain your counts:

In an adjacent column use the formula

=IF(AND($B4>TODAY(),$B4<TODAY()+30),1,0)

to yield a 1 if the data is within 30 days of today, 0 otherwise. Then sum the column to get the number of days.

Similarly you can use formulas:

=IF(AND($B4>TODAY()+30,$B4<TODAY()+90),1,0)

and

=IF($B4>TODAY()+90,1,0)

to get counts of the dates 30-90 days in the future, and more than 90 days in the future, respectively.
 

Damon Ostrander

MrExcel MVP
Joined
Feb 17, 2002
Messages
4,239
Hi again Ian,

For some reason I didn't get the complete formulas copied in my previous post for the first two formulas. They should have been:

=IF(AND($B4>TODAY(),$B4<TODAY()+30),1,0)

and

=IF(AND($B4>TODAY()+30,$B4<TODAY()+90),1,0)

Damon
 

IML

MrExcel MVP
Joined
Feb 15, 2002
Messages
1,743
Damon's post with HTML diabled

On 2002-11-05 14:21, Damon Ostrander wrote:
Hi again Ian,

For some reason I didn't get the complete formulas copied in my previous post for the first two formulas. They should have been:

=IF(AND($B4>TODAY(),$B4<TODAY()+30),1,0)

and

=IF(AND($B4>TODAY()+30,$B4<TODAY()+90),1,0)

Damon
 

Damon Ostrander

MrExcel MVP
Joined
Feb 17, 2002
Messages
4,239
Thanks IML,

I thought I had pasted the wrong string. I'll try to remember to disable HTML after this.

Damon
 

Forum statistics

Threads
1,144,766
Messages
5,726,173
Members
422,659
Latest member
RGP268

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
Top