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
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,918
Office Version
  1. 365
Platform
  1. Windows
Try this.

=IF(D8="3-Dec-12"+0,"IM","IS")
 

candle_66

New Member
Joined
Nov 10, 2005
Messages
22
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
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,918
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Howard

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

Excel stores dates as long integers.
 

seenfresh

Well-known Member
Joined
Jul 12, 2006
Messages
1,141
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
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,918
Office Version
  1. 365
Platform
  1. Windows
sean

Do you definitely have a true date value in D8?
 

seenfresh

Well-known Member
Joined
Jul 12, 2006
Messages
1,141
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!
 

Watch MrExcel Video

Forum statistics

Threads
1,114,061
Messages
5,545,765
Members
410,704
Latest member
Cobber2008
Top