If and or statement

TL30N

New Member
Joined
May 16, 2016
Messages
47
Hi,

I have multiple conditions that I want to satisfy in an IF statement and am having a spot of bother.

In order to classify as new I want AD ABOVE 300, AE TO BE C, AF to be above 90%, AK to be "Stable Price" and AL to be between 4 weeks 201712,201713,201714 and 201715. I have the following below, but I'm having a problem

IF(((AND(AD7>300,AE7="C",AF7>90%,AK7="Stable Price",AL7="201712,201713,201714,2015","NEW","NOT NEW")))))

But it's not working, will somebody help please?

I think I need to add an OR in the dates, but not sure where.

Thanks
 
Last edited:

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

BarryL

Well-known Member
Joined
Jan 20, 2014
Messages
1,436
Office Version
  1. 2019
Platform
  1. Windows
  2. MacOS
without seeing your data set its hard to tell if this will work but try

=IF(AND(AD7>300,AE7="C",AF7>90%,AK7="Stable Price"),IF(OR(AK7="201712",AK7="201713",AK7="201714",AK7="201715"),"NEW","NOT NEW"),"NOT NEW")
 
Upvote 0

pjmorris

Well-known Member
Joined
Aug 2, 2012
Messages
2,102
Office Version
  1. 2016
Platform
  1. Windows
Hi,

Not quite sure what you mean by dates expressed as 201712 or 201715, but assuming they are dates then try this:

=IF(((AND(AD7>300,AE7="C",AF7>90%,AK7="Stable Price",AL7=>"201712",AL7<"201715","NEW","NOT NEW")))))

I can improve this if you can describe how you have arrived at these dates.

Regards
 
Last edited:
Upvote 0

gaz_chops

Well-known Member
Joined
Apr 29, 2003
Messages
6,485
Platform
  1. MacOS
Try

=IF(AND(AD7>300,AE7="C",AF7>90%,AK7="Stable Price",OR(AL7={201712,201713,201714,2015})),"NEW","NOT NEW")
 
Upvote 0

TL30N

New Member
Joined
May 16, 2016
Messages
47
Try

=IF(AND(AD7>300,AE7="C",AF7>90%,AK7="Stable Price",OR(AL7={201712,201713,201714,2015})),"NEW","NOT NEW")


Hi both,
AD AE AF AG AH AI AK AL
Number of Stores PKCS (max)Branch Availability £ Price Wk-4 £ Price Wk-3 £ Price Wk-2 £ Price Wk-1 Stable Price F'cast Start Date
S > P > K > C(Stock-in days %, Last Wk)(Thur, UK) (Thur, UK) (Thur, UK) (Thur, UK) ()
(Fncl Wk)
363 K93% £ 134.00 £ 134.00 £ 134.00 £ 134.00 Stable Price 201651
362 P29% £ 77.00 £ 77.00 £ 77.00 £ 77.00 Stable Price 201645
365 K25% £ 79.00 £ 79.00 £ 79.00 £ 79.00 Stable Price 201446
Does the data below help? Peter, I couldn't get your formula to work and Barry, I didn't get the right answer with yours. Really appreciate the help.

<colgroup><col span="15"></colgroup><tbody>
</tbody>
 
Upvote 0

gaz_chops

Well-known Member
Joined
Apr 29, 2003
Messages
6,485
Platform
  1. MacOS
Did mine work? It appears to!

Are the Year/Week No.s text or numbers?

Code:
[TABLE="width: 650"]
<!--StartFragment--> <colgroup><col width="65" span="10" style="width:65pt"> </colgroup><tbody>[TR]
  [TD="width: 65"][/TD]
  [TD="width: 65"][/TD]
  [TD="width: 65"][/TD]
  [TD="width: 65"][/TD]
  [TD="width: 65"][/TD]
  [TD="width: 65"][/TD]
  [TD="width: 65"][/TD]
  [TD="width: 65"][/TD]
  [TD="width: 65"][/TD]
  [TD="width: 65"][/TD]
 [/TR]
 [TR]
  [TD]NEW[/TD]
  [TD="align: right"]363[/TD]
  [TD]C[/TD]
  [TD="class: xl63, align: right"]93%[/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
  [TD]Stable Price[/TD]
  [TD="align: right"]201712[/TD]
 [/TR]
 [TR]
  [TD]NOT NEW[/TD]
  [TD="align: right"]400[/TD]
  [TD]C[/TD]
  [TD="align: right"]200[/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
  [TD]Stable Price[/TD]
  [TD="align: right"]201651[/TD]
 [/TR]
 [TR]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
 [/TR]
<!--EndFragment--></tbody>[/TABLE]
 
Last edited:
Upvote 0

BarryL

Well-known Member
Joined
Jan 20, 2014
Messages
1,436
Office Version
  1. 2019
Platform
  1. Windows
  2. MacOS
the below works for me

=IF(AND(AD6>300,AE6="C",AF6>90%,AK6="Stable Price"),IF(AND(AL6>=201712,AL6<=201715),"NEW","NOT NEW"),"NOT NEW")
 
Upvote 0

pjmorris

Well-known Member
Joined
Aug 2, 2012
Messages
2,102
Office Version
  1. 2016
Platform
  1. Windows
Hi TL30N,

The key, I think, will be in your answer to Gaz's question about the format of the year/week. If I were to assume it is a number then this should work:

=IF(((AND(AD7>300,AE7="C",AF7>90%,AK7="Stable Price",AL7=>201712,AL7<201715,"NEW","NOT NEW")))))

where the quote marks have been removed from the dates.

HTH.
 
Upvote 0

Forum statistics

Threads
1,191,576
Messages
5,987,386
Members
440,095
Latest member
yanaungmyint

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