If Statements to match a date

shekala

New Member
Joined
Feb 19, 2006
Messages
13
What would be the most direct way to determine if the date of a cell matches the month and date of another cell?
For example, cell A1 = 10/12/18 and I need an if statement to compare its date to a row showing various months and years - b1 = 10/17, c1 = 10/18, d1 = 10/19

Thus, need an If statement to return a result of c1.
Thanks
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
What would be the most direct way to determine if the date of a cell matches the month and date of another cell?
For example, cell A1 = 10/12/18 and I need an if statement to compare its date to a row showing various months and years - b1 = 10/17, c1 = 10/18, d1 = 10/19

Thus, need an If statement to return a result of c1.
Thanks
Is that what you ask for?
Code:
=if(and(month(A1)=month(c1),year(A1)=year(c1)),c1,false)
I don't get it, don't you need a hlookup? (which also make no sense to me since the value can me obtained by
Code:
=month(a1)&"/"&right(year(a1),2)
or =a1 and format as mm/yy)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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
Back
Top