Help with formula using an ampersand for year

RunTime91

Active Member
Joined
Aug 30, 2012
Messages
276
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

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
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,214,983
Messages
6,122,582
Members
449,089
Latest member
Motoracer88

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