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?
 

Some videos you may like

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,218
Office Version
  1. 365
Platform
  1. Windows
So if value in Year matches last year, e.g. 2018, return 1 else return 0?
 

Joanne 56

New Member
Joined
Jan 23, 2016
Messages
14
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,721
Messages
5,597,752
Members
414,171
Latest member
12Rev79

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