Dates in IF Function ?

Neveraliein

New Member
Joined
Jun 16, 2008
Messages
2
This is really getting to me because I'm sure it's simple.
In Row 1 we have months mmm
In Column A there are various dates dd/mmm/yy
We, ultimately, want columns to total so we know occurences per month. IF A2 = date in jan it will return value of 1 in B2.
We tried (in B2) =IF(AND(A2>31/12/2007,A2<30/1/2008),1,0)

Bet someone has asked this before, but I haven't found anything in previous posts.

Any assistance would be appreciated
Thanks
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Gerald Higgins

Well-known Member
Joined
Mar 26, 2007
Messages
9,258
Hi N. . . and welcome to the board.

Perhaps try
Code:
=if(and(a2>date(2007,12,31),a2< date(2008,1,30)),1,0)<DATE(2008,1,30)),1,0)< p>
 
Upvote 0

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
Rather than testing each date separately you could use one formula that will count how many dates are in each month, e.g.

=SUMPRODUCT(--(TEXT(A2:A100,"mmm-yy")="jan-08"))

will count how many dates in A2:A100 fall in January 2008
 
Upvote 0

Forum statistics

Threads
1,191,521
Messages
5,987,073
Members
440,074
Latest member
Emmanuelian

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