Concatenate Text with Date plus an IF field that will include date

maloney12

New Member
Joined
May 13, 2015
Messages
3
Hi,
I have a start date and an end date. Sometimes the end date is blank. I want the end date to read Pres if there is no date.

=""&TEXT(E2,"yyyy")&" - "&IF(F2="","Pres",F2)

F2 is the end date - so it part way works: 2005 - Pres if F2 is blank. But if it isn't blank how can I get it to put the date field in to read:
2005 - 2014?

I tried =""&TEXT(E2,"yyyy")&" - "&IF(F2="","Pres",F2, "yyyy") - to many arguments.

Anyone that can help it would be very much appreciated!

Thank you!
Lori
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
maybe something like...

=TEXT(E2,"yyy")&" - "&IF(F2="","Pres",TEXT(F2,"yyy")) ?
 
Upvote 0
Welcome to the board. You weren't far off, try:
Code:
=TEXT(E2,"YYYY") & " - " & IF(F2="","Pres",TEXT(F2,"YYYY"))
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,126
Members
452,381
Latest member
Nova88

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