If statement with date

BCsehi

New Member
Joined
Jan 20, 2011
Messages
23
I have dates in col A. In col B, I want to write an IF statement that says:
=if(A1<2/11/13,Jan,Feb). I know that this is not a valid formula and I get a NAME error. Can someone help me write the statement correctly? Thanks!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Based on what it looks like you are trying to do, perhaps:

=IF(MONTH(A2-10)=1,"Jan","Feb")

or

=IF(A2<("2/11/13"+0),"Jan","Feb")
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
If you want to continue that format for every month:

=TEXT(MONTH(A2-10)*29,"mmm")
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,978
Office Version
  1. 2016
Platform
  1. Windows
I have dates in col A. In col B, I want to write an IF statement that says:
=if(A1<2/11/13,Jan,Feb). I know that this is not a valid formula and I get a NAME error. Can someone help me write the statement correctly? Thanks!
You could try this (note the use of quote marks... the 1* is to convert the date text into a real date)...

=IF(A1<1*"2/11/14","Jan","Feb")
 

BCsehi

New Member
Joined
Jan 20, 2011
Messages
23

ADVERTISEMENT

I copied your formula (changed the 2/11/14 to 2/11/13), and copied the formula down and I get Feb for all dates even those with 1/23/13 dates???
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,978
Office Version
  1. 2016
Platform
  1. Windows
Thanks for your help. I think I have it licked!!
Great! Sorry about the 14 for 13 typo... not sure how that happened, but I am glad you saw through it and corrected for it.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,804
Messages
5,638,450
Members
417,025
Latest member
MusterDuster

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