Trouble interpreting date range. Excel2007

sdandolini

New Member
Joined
Jan 11, 2011
Messages
4
I am trying to build an Equipment Replacement Schedule for computer hardware.

I have a column that reads the warranty start date and adds the number of years that has been determined as the replacement cycle. That looks like this:

=IF(ISBLANK(H6),"",DATE(YEAR(H6)+Summary!$C$18,MONTH(H6),DAY(H6)))

That returns a series of dates. If the warranty start date is 1/1/2005 and the cycle is 4 years, the date would be 1/1/2009.

We purchase our computers in 4 quarterly purchases. July 15th, November 15th, February 15th, and May 15th.

What I am trying to do is create a column that looks at that date and assigns the closest quarterly purchase.

I am hoping someone has some ideas for me.

Thank You !
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
The closest quarterly purchase before or after the calculated date?
 
Upvote 0
Can you try this array formula ( entered using Ctrl-Shift-Enter instead of Enter ):
Code:
=MIN(IF(DAY(A3+ROW($1:$130)-1)=15,IF(MONTH(A3+ROW($1:$130)-1)={2,5,7,11},A3+ROW($1:$130)-1,99999),99999))
... replacing all occurences of A3 with the cell reference of your test date.

When a cell contains an array formula, Excel puts curly brackets "{}" around the formula, to indicate that it's an array formula.
 
Upvote 0
Wow !

It works. You are amazing. Thanks!

I will have to take some time and try and figure out how this formula works.

Thanks again!
 
Upvote 0
I think you could also use this non array version for the same result

=DATE(YEAR(A3),LOOKUP(A3,DATE(YEAR(A3),{0,2,5,7,11},16),{2,5,7,11,14}),15)
 
Upvote 0
.....or a shorter version....

=LOOKUP(A3-1,DATE(YEAR(A3),{0,2,5,7,11;2,5,7,11,14},15))

Wow,

This is a nice one.

what I can not understand is deducting 1 from A3 in "A3-1".

Could you explain if you do not mind?
 
Last edited:
Upvote 0
Hello Fowmy,

If you don't subtract 1 then any date that is exactly on one of the purchase dates will be "bumped" to the next purchase date, e.g. if A3 is 15th Nov 2010 then without the -1 you'd get the answer as 15th Feb 2011

In the previous version I got round that by using 16 and 15 but for the shorter version to work all the dates are 15th
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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