Lookup the first date of the month

BigBeachBananas

Active Member
Joined
Jul 13, 2021
Messages
450
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi,
I'm looking for a way to look up the first date of the month in a range as well as its corresponding value. Please see the sample below. Thanks
book1.xlsb
ABCDE
1Sample DataOutCome
2DateTreasury RatesDateTreasury Rates
312/31/20042.7512/1/20042.6
412/30/20042.7611/1/20042.34
512/29/20042.77
612/28/20042.77
712/27/20042.78
812/8/20042.59
912/7/20042.6
1012/6/20042.6
1112/3/20042.58
1212/2/20042.62
1312/1/20042.6
1411/30/20042.63
1511/29/20042.66
1611/12/20042.49
1711/10/20042.47
1811/9/20042.46
1911/8/20042.47
2011/5/20042.44
2111/4/20042.34
2211/3/20042.32
2311/2/20042.33
2411/1/20042.34
Sheet3
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
This can be done pretty easily with the new FILTER function.
In your Outcome section, enter this formula in the first cell under DATE:
Excel Formula:
=FILTER(A3:B24,DAY(A3:A24)=1)

It should return exactly what you show.
 
Upvote 0
This can be done pretty easily with the new FILTER function.
In your Outcome section, enter this formula in the first cell under DATE:
Excel Formula:
=FILTER(A3:B24,DAY(A3:A24)=1)

It should return exactly what you show.
Hi Joe4,
Thank you for the reply. Sorry for the incomplete sample data, but the first day of the month isn't always 1. Sometimes it can be the 2nd or the 3rd of the month.
 
Upvote 0
Hi Joe4,
Thank you for the reply. Sorry for the incomplete sample data, but the first day of the month isn't always 1. Sometimes it can be the 2nd or the 3rd of the month.
Ah, the dangers of oversimplified data examples (the reply answers the question you posed correctly, but does not work on your actual data because of the oversimplification)!

A few questions:
1. Is your data always sorted in date order, like you show in your example (sorted in descending order)?
2. Do you have any issues with adding/using a "helper" column?
 
Upvote 0
Ah, the dangers of oversimplified data examples (the reply answers the question you posed correctly, but does not work on your actual data because of the oversimplification)!

A few questions:
1. Is your data always sorted in date order, like you show in your example (sorted in descending order)?
2. Do you have any issues with adding/using a "helper" column?
1) Yes, It's in descending order (December to January)
2) No, I don't have an issue with adding an other column
 
Upvote 0
Excellent.

Then place this formula in cell C3 and copy down for all rows:
Excel Formula:
=IF(TEXT(A3,"mmyy")<>TEXT(A4,"mmyy"),1,0)

Then we can update the FILTER formula to this:
Excel Formula:
=FILTER(A3:B28,C3:C28=1)
 
Upvote 0
Solution
Excellent.

Then place this formula in cell C3 and copy down for all rows:
Excel Formula:
=IF(TEXT(A3,"mmyy")<>TEXT(A4,"mmyy"),1,0)

Then we can update the FILTER formula to this:
Excel Formula:
=FILTER(A3:B28,C3:C28=1)
It worked. Awesome. Thanks!
 
Upvote 0

Forum statistics

Threads
1,214,825
Messages
6,121,788
Members
449,049
Latest member
greyangel23

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