IF Question

candle_66

New Member
Joined
Nov 10, 2005
Messages
22
I have a problem with a simple IF statement.

I have tapes with a return date of 2012. I want to autofill another cell with IM if there is a date of 2012 in the return date cell

My formula is in H8 and is =IF(D8=3-Dec-12,IM,IS)

D8 has the date of 3-Dec-12

The formula is in H8 and should retun IM but I get #NAME?

I am sure this is a simple problem

Thanks in advance
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Try this.

=IF(D8="3-Dec-12"+0,"IM","IS")
 
Upvote 0
Thank you Norrie

I had tried the first suggestion before I posted. It did not work.

But by adding +0 it did.

Thank you.

Why would I need +0 out of interest

Thanks again

Howard
 
Upvote 0
Howard

The +0 coerces the string to a number, in this case a date.

Excel stores dates as long integers.
 
Upvote 0
Norie: quick question!

If by example cell D8 was formated to show Date under format cells in any specified appearance:

Why would this formula not work? =IF(D8=Date(2003,12,12),"IM","IS")
Date(2003,12,12) would be interpreted as December 12, 2003, thus the same date as 3-12-12 following date formating, but would their be a problem due to assigned serial numbers for the date function and cell D8 would not be interpreted this way?

Thanks in advance
 
Upvote 0
sean

Do you definitely have a true date value in D8?
 
Upvote 0
Well it would'nt be because excel does not generate date formats like:

3-12-12

correct!

what if in D8 showed: 12/12/2003 would this be interpreted as serial number for date format and thus = Date(2003,12,12)

Thanks again!
 
Upvote 0

Forum statistics

Threads
1,214,530
Messages
6,120,071
Members
448,943
Latest member
sharmarick

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