Date extraction question

sitewolf

Active Member
Joined
May 4, 2012
Messages
304
It could be all my neurons simply aren't firing yet this morning, because I think this should be relatively simple but it's just not coming to me.

Each month I have a list of transactions, but because the (external so I can't change it) cutoff date isn't the first of the month, that list will always have some transactions from both the prior month and the current month. I want to keep the correct dates in my transaction log, but to upload into my accounting software I want dates to be all current month.

Example dates from my log:
9/27/22
9/29/22
10/4/22
10/7/22

What I want is an if statement where if a date is = or > than the 1st of the current month, it uses the correct date, but if it's < the 1st of the current month, it spits out the 1st of the current month.
In the above example, then, the formula would spit out 10/1/22 for the first 2. There's a journal entry date I'd be typing in to use as the current month, so I don't have to futz with that part of determining current.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
If that puts prior month dates to the 1st of the current month, it may be more elegant than what I just came up with
=IF(A1<F1-DAY(F1)+1,F1-DAY(F1)+1,A1) (where F1 is the control date)

Thanks!
 
Upvote 0
As long as you put the 1st day of the month in the Current Month cell then it will use that date for anything with a month less than that cell, if that makes sense?
 
Upvote 0
It does, and that may be the simpler way to go....but the date I was wanting to use as my control date will generally be, for example, 10/27 (late in the month, the statement date)
BUT, I could use a formula to spit out 10/1 in that example and use THAT as my control date.

This is a credit card transaction log, so dates will always be either current month or a few from the prior month, because the statement cutoff is late in the month (i.e. the 27th)
 
Upvote 0
Using GeorgiBoy's example, replacing the formula in C3.
Excel Formula:
=MAX(B3,$F$2)
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,198
Members
449,072
Latest member
DW Draft

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