M code for same date last year

Joanne 56

New Member
Joined
Jan 23, 2016
Messages
14
Hi. I have a problem that is driving me nuts. Am fairly new to M code but thought trial and error would have solved my problem by now. Upside is I have learned a lot on the way even if I still haven't solved my problem. I have a (text) column called EntryDate with the date of all orders keyed over a number of years, and another column called Year which shows the year the order was received. I am wanting to add a custom column for year to date orders from last year (if entry date matches year to date last year then 1, else 0) so I can compare with this year.

Can someone please help out?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
So if value in Year matches last year, e.g. 2018, return 1 else return 0?
 
Upvote 0
Yip - so if the EntryDate = between 01/01/18 and today's day and month and the year is 2018 then return 1 else return 0. Thanks.
 
Upvote 0

Forum statistics

Threads
1,213,544
Messages
6,114,239
Members
448,555
Latest member
RobertJones1986

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