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

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,304
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
76,304
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
76,304
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!
 

Forum statistics

Threads
1,141,924
Messages
5,709,382
Members
421,633
Latest member
Ubergribbler

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
Top