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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

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
37,893
Office Version
  1. 2019
  2. 2010
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
37,893
Office Version
  1. 2019
  2. 2010
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,530
Messages
5,837,891
Members
430,520
Latest member
VenkateshRajaganesan

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