copy date, if cell blank use todays date

Kevw1

New Member
Joined
Dec 6, 2017
Messages
36
Hi I have the following working formula, but now need to update it.

=IF(ISBLANK('Raw data'!A2),"",DATE(YEAR('Rawdata'!A2),MONTH('Raw data'!A2),1))

I am now trying to add todays date rather than a blank value by adapting the formula, I am getting a #Value returned with the updated formula:-

=IF(ISBLANK('Raw data'!A2),TODAY(),DATE(YEAR('Rawdata'!A2),MONTH('Raw data'!A2),1))

anyone have any ideas what I am doing wrong please? I have tried several ways to strip the time from the date, this was the only way it would provide the output needed and was working until I add todays date. I use the output as a base for a second formula hence needing the output format to be the same.



 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
You have inconsistent reference to "Raw data" - are you missing a space in the YEAR() reference?

WBD
 
Upvote 0
Hi thanks for the quick reply's it was a Typo adding the formula to the forum not in the actual formula, "Raw data" is correct, I just copied the formula wrong as working on a different computer, so the problem is still happening.


=IF(ISBLANK('Raw data'!A2),TODAY(),DATE(YEAR('Raw data'!A2),MONTH('Raw data'!A2),1))

The formula works correct if I replace
TODAY() with "" but when changed to Today() this is when I get the #Value , also the TODAY value will need to be MONTH,1 also is this just TODAY(MONTH,1)??

The output is used in an index to match to a monthly forecast.
<strike>
</strike>
 
Upvote 0
As for why you get a value error. That can only happen should A2 be a text value i think. Cant see any other reason.
 
Upvote 0
Hi Steve, all working many thanks for your help with this, issue resolved.

I had tried so many ways to strip the date and convert, this has been the best one, with the today date also thanks
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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