Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

if function criteria

Forum home » Delegate support and help forum » Microsoft Excel Training and help » IF function - criteria not working

IF function - criteria not working

ResolvedVersion 365

IF function - criteria not working

Another help to fix a IF criteria:
Formula is: =IF(OR([@Scope]="No Trade",[@Scope]="Out of scope"),"Out",IF([@[Is it lapsed?]]="Yes","Lapsed",IF([@[Legacy SAQ last modified]]>=2019,"Wave2","Wave1")))

All criteria are working, apart from the last one, where I want to indicate "Wave 2" for dates that are >or= to 2019 and "Wave 1" to everything that is < or = to 2018.
When I apply the formula, the result does not differentiate the criteria for the years, bringing all results as "WAVE 2".
The only results as "Wave 1" it is indicated to the date: 00/01/1900.

The column "Legacy SAQ last modified" is formatted as Short Date, and contains dates between 2014 to 2019 and some 00/01/1900.

Appreciate the support!
Many thanks.

RE: IF function - criteria not working

Hi Cecilia,

Thank you for the forum question.

If you have a short date in a column then you can test the year.

If you type the date 26 March 2020 and change the formatting to general or number format you will get the number 43916.

And if you type 01/01/1983 and change the format you will get 30317.

Your test if the date is 01/01/1983 will be 30317>=2019.

The best solution is to add a column with the year and then test the year column. You can use the Year function to extract the year from the date: =Year([@[Legacy SAQ last modified]])

I hope this makes sense.

Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: IF function - criteria not working

Hi Jens,

Thanks, I believe I understood the logic, however I am not sure what is wrong now.
I have added a new column for the year, when I use the formula
=YEAR([@[Legacy SAQ last modified]]) the result is as per below example:

Legacy SAQ last modified Year (using =YEAR)
14/03/2020 12/07/1905
05/03/2019 11/07/1905
12/02/2019 11/07/1905
00/01/1900 14/03/1905
12/06/2018 10/07/1905
12/06/2018 10/07/1905

Once again, thanks for the support.

RE: IF function - criteria not working

got it !!!!
In Year column, I've left as "date".
Awesome, many thanks for all the help :)

Excel tip:

Changing Excel file and worksheet defaults

The appearance of any new Excel files or any new worksheets that are inserted into a file are controlled by two template files, Book.xlt and Sheet.xlt.

By opening, modifying and saving these templates you can change the default settings for all new files and/or all newly inserted sheets.

Use Book.xlt to make change to defaults for new workbooks; and Sheet.xlt to change defaults for sheets.

If you can't find either of these files on your computer, you can create and save them yourself.

You can do this simply by creating a new workbook with the setting you want to use as your defaults; then saving them with the appropriate name in the XLStart folder. If you are using Office 2003, this is usually found in C:\Program Files\Microsoft Office\Office11\XLStart.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.12 secs.