PDA

View Full Version : If statement help



MattehWoo
09-04-2020, 05:56 AM
Hi all,

I'm having a bit of a Friday afternoon post lunch brain freeze.

I have a table (below) that has a range of data and i want to create an if statement so that it populates the final column as shown. It tells me if the product is still existing from last year. If the product has changed but is still with the same company (an upgrade on the old version) or if we have gone with a completely new product with a new company to replace the old one...

Now i believe i am right in thinking i need an IF(OR(AND statement but all the blood has left my brain and is currently digesting a large amount of food and all i want to do is take a nap.



LY Product
Prod Change
Brand New Prod
New Company
Type


No
Yes
No
Yes
Company & Prod Change


No
Yes
No
Yes
Company & Prod Change


No
Yes
No
Yes
Company & Prod Change


Yes



Existing


Yes



Existing


Yes



Existing


Yes



Existing


No
No
Yes
Yes
Brand New


Yes



Existing


No
No
Yes
Yes
Brand New


No
No
Yes
Yes
Brand New


No
No
Yes
Yes
Brand New


Yes



Existing


Yes



Existing


No
No
Yes
Yes
Brand New


Yes



Existing


No
No
Yes
Yes
Brand New


Yes



Existing


Yes



Existing


Yes



Existing


Yes



Existing


Yes



Existing


Yes



Existing


No
No
Yes
Yes
Brand New


Yes



Existing


Yes



Existing


Yes



Existing


No
Yes
No
No
Product Change Only



Thankyou for any help!

Bob Phillips
09-04-2020, 08:14 AM
This should do it, and easily amendable for any other combinations


=INDEX({"Existing","Brand New","Product Change Only","Company &Prod Change"},
MATCH(A2&B2&C2&D2,{"Yes","NoNoYesYes","NoYesNoNo","NoYesNoYes"},0))