MrPink1986
Active Member
- Joined
- May 1, 2012
- Messages
- 252
Hi,
I have a date which I will need to increment the date by a day, month or year from the actual date. This is based of a list of fields below and is different per the input. Also each resultant date has to be a business day i.e not a weekend day or a bank holiday. I will forgo the Bank Holiday requirement now.
I am using the formula - =DATE(YEAR($A$1),MONTH($A$1),DAY($A$1)) and hard coding the increment value in each row based of the value in B4 below.
Also once we get past SP in column A4 the formula changes to reference the date created by using the value at the SP value.
So if we put the results in to column E the formula will change to =DATE(YEAR($E$6),MONTH($E$6),DAY($E$6))
The date also needs to be in the format text(xx,"mm/dd/yyyy")
Any suggestions on how to create this in Excel of VIA a VBA solution macro would be appreciated
Inputs
A1
=today()
A4 B4
[TABLE="width: 188"]
<colgroup><col span="2"></colgroup><tbody>[TR]
[TD]ON[/TD]
[TD]1 Day[/TD]
[/TR]
[TR]
[TD]TN[/TD]
[TD]2 Day[/TD]
[/TR]
[TR]
[TD]SP[/TD]
[TD]2 Day[/TD]
[/TR]
[TR]
[TD]SN[/TD]
[TD]2 Day[/TD]
[/TR]
[TR]
[TD]1W[/TD]
[TD]7 Day[/TD]
[/TR]
[TR]
[TD]2W[/TD]
[TD]14 Day[/TD]
[/TR]
[TR]
[TD]3W[/TD]
[TD]21 Day[/TD]
[/TR]
[TR]
[TD]1M[/TD]
[TD]1 Month[/TD]
[/TR]
[TR]
[TD]2M[/TD]
[TD]2 Month[/TD]
[/TR]
[TR]
[TD]3M[/TD]
[TD]3 Month[/TD]
[/TR]
[TR]
[TD]4M[/TD]
[TD]4 Month[/TD]
[/TR]
[TR]
[TD]5M[/TD]
[TD]5 Month[/TD]
[/TR]
[TR]
[TD]6M[/TD]
[TD]6 Month[/TD]
[/TR]
[TR]
[TD]7M[/TD]
[TD]7 Month[/TD]
[/TR]
[TR]
[TD]8M[/TD]
[TD]8 Month[/TD]
[/TR]
[TR]
[TD]9M[/TD]
[TD]9 Month[/TD]
[/TR]
[TR]
[TD]10M[/TD]
[TD]10 Month[/TD]
[/TR]
[TR]
[TD]11M[/TD]
[TD]11 Month[/TD]
[/TR]
[TR]
[TD]1Y[/TD]
[TD]1 Year[/TD]
[/TR]
[TR]
[TD]15M[/TD]
[TD]15 Month[/TD]
[/TR]
[TR]
[TD]18M[/TD]
[TD]18 Month[/TD]
[/TR]
[TR]
[TD]21M[/TD]
[TD]21 Month[/TD]
[/TR]
[TR]
[TD]2Y[/TD]
[TD]2 Year[/TD]
[/TR]
[TR]
[TD]3Y[/TD]
[TD]3 Year[/TD]
[/TR]
[TR]
[TD]4Y[/TD]
[TD]4 Year[/TD]
[/TR]
[TR]
[TD]5Y[/TD]
[TD]5 Year[/TD]
[/TR]
[TR]
[TD]6Y[/TD]
[TD]6 Year[/TD]
[/TR]
[TR]
[TD]7Y[/TD]
[TD]7 Year[/TD]
[/TR]
[TR]
[TD]8Y[/TD]
[TD]8 Year[/TD]
[/TR]
[TR]
[TD]9Y[/TD]
[TD]9 Year[/TD]
[/TR]
[TR]
[TD]10Y[/TD]
[TD]10 Year[/TD]
[/TR]
[TR]
[TD]15Y[/TD]
[TD]15 Year[/TD]
[/TR]
[TR]
[TD]20Y[/TD]
[TD]20 Year[/TD]
[/TR]
[TR]
[TD]25Y[/TD]
[TD]25 Year[/TD]
[/TR]
[TR]
[TD]30Y[/TD]
[TD]30 Year[/TD]
[/TR]
</tbody>[/TABLE]
I have a date which I will need to increment the date by a day, month or year from the actual date. This is based of a list of fields below and is different per the input. Also each resultant date has to be a business day i.e not a weekend day or a bank holiday. I will forgo the Bank Holiday requirement now.
I am using the formula - =DATE(YEAR($A$1),MONTH($A$1),DAY($A$1)) and hard coding the increment value in each row based of the value in B4 below.
Also once we get past SP in column A4 the formula changes to reference the date created by using the value at the SP value.
So if we put the results in to column E the formula will change to =DATE(YEAR($E$6),MONTH($E$6),DAY($E$6))
The date also needs to be in the format text(xx,"mm/dd/yyyy")
Any suggestions on how to create this in Excel of VIA a VBA solution macro would be appreciated
Inputs
A1
=today()
A4 B4
[TABLE="width: 188"]
<colgroup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