Add and (+) conditions to or FILTER criteria

ollyhughes1982

Well-known Member
Joined
Nov 27, 2018
Messages
793
Office Version
  1. 365
Platform
  1. MacOS
Hi,

I have the below formula:

=IFERROR(FILTER('All Completed Runs'!C4:C2003,('All Completed Runs'!EC4:EC2003<>"")*('All Completed Runs'!FL4:FL2003<>1)*('All Completed Runs'!D4:D2003="Singapore")),"")

I want to tag onto the end the function two extra criteria; the result should only be positive if:
  • The year is greater than 2019
  • The year is less than 2023
(i.e. The year is either 2020, 2021 or 2022) 'All Completed Runs'!AJ is the Year column.

I have tagged the "and (+)" conditions *(('All Completed Runs'!AJ4:AJ2003>2019)+(‘All Completed Runs'!AJ4:AJ2003<2023)) on to the end. Is this correct? Amended function below:

=IFERROR(FILTER('All Completed Runs'!C4:C2003,('All Completed Runs'!EC4:EC2003<>"")*('All Completed Runs'!FL4:FL2003<>1)*('All Completed Runs'!D4:D2003="Singapore")*(('All Completed Runs'!AJ4:AJ2003>2019)+(‘All Completed Runs'!AJ4:AJ2003<2023))),””)

Thanks in advance!

Olly.
 
Could be dates stored as text (i.e. if you change the formatting of column B to number and the dates still display as dd/mm/yyyy, they are dates stored as text values and not actually Excel dates).

Try using (('All Completed Runs'!AJ4:AJ2003+0)<DATEVALUE("01/01/2020")) instead of ('All Completed Runs'!AJ4:AJ2003<DATEVALUE("01/01/2020")) and similar for 12/31/2013's comparative.
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
That didn't seem to work, still the same result. Formulas I have used below:

=IF(A4="","",(IFERROR(UNIQUE(FILTER('All Completed Runs'!E4:E2003,'All Completed Runs'!BN4:BN2003<>"")*('All Completed Runs'!FL4:FL2003<>1)*(('All Completed Runs'!AJ4:AJ2003+0)>DATEVALUE("31/12/2013"))*(('All Completed Runs'!AJ4:AJ2003+0)<DATEVALUE("01/01/2020"))*(('All Completed Runs'!D4:D2003="United Kingdom")+('All Completed Runs'!D4:D2003="Australia")+('All Completed Runs'!D4:D2003="Austria")+('All Completed Runs'!D4:D2003="France")+('All Completed Runs'!D4:D2003="Ireland")+('All Completed Runs'!D4:D2003="Italy")+('All Completed Runs'!D4:D2003="New Zealand"))),"")))

The source column AJ is formatted as 'General' and uses the following formula to calculate:

=IF(E4<>"",YEAR(E4),"")

E is the original date column and is formatted as 'Date' and '14/03/2012' format.

Screenshot 2022-11-08 at 21.23.50.jpg
 
Upvote 0
I have now resolved this. I had a bit of a mistake in the original date formula. Fixed as per below:

=IF(A4="","",(IFERROR(UNIQUE(FILTER('All Completed Runs'!E4:E2003,('All Completed Runs'!BN4:BN2003<>"")*('All Completed Runs'!FL4:FL2003<>1)*(('All Completed Runs'!D4:D2003="United Kingdom")+('All Completed Runs'!D4:D2003="Australia")+('All Completed Runs'!D4:D2003="Austria")+('All Completed Runs'!D4:D2003="France")+('All Completed Runs'!D4:D2003="Ireland")+('All Completed Runs'!D4:D2003="Italy")+('All Completed Runs'!D4:D2003="New Zealand")))),"")))
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,223
Members
452,620
Latest member
dsubash

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