Help with formula using an ampersand for year

RunTime91

Active Member
Joined
Aug 30, 2012
Messages
290
Office Version
  1. 365
Greetings...

I need a formula that provides calculations for random dates which may extend backwards into last year.

In A3 is an emp. hire date (which may be a date before this year) and I want to subtract from that date today's date

The formula doesn't error but since the hire date is entered as a date and the concatenation I use in the formula puts quotation marks on the date it provides the wrong result.

Any idea's would be great...

Code:
=IF(B3-A3<91,0,IF(A3<"3/1/"&YEAR(TODAY()),56,IF(AND(A3>="3/1/"&YEAR(TODAY()),A3<"5/1/"&YEAR(TODAY())),32,IF(AND(A3>="5/1/"&YEAR(TODAY()),A3<"9/30/"&YEAR(TODAY())),16,IF(A3>="10/1/"&YEAR(TODAY()),56,0)))))
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Rather than using this construction for a date

"3/1/"&YEAR(TODAY())

Try using DATE function, like this

DATE(YEAR(TODAY()),3,1)
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,239
Members
452,621
Latest member
Laura_PinksBTHFT

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