Excel Search words from a cell and assign txt in another cell

[Closed]
Report
Posts
1
Registration date
Saturday March 2, 2013
Status
Member
Last seen
March 2, 2013
-
Posts
2818
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
October 18, 2021
-
Hello,

I am having data like whi below:

A B

1. customer1 TV
Fridge
Microwave

2. customer2 TV

3. customer3 Fridge
Microwave

4. customer4 TV
Fridge

All are in single Row(Eg. TV, Fridge, Microwave).

My requirement is to search a word and assign a word in another column say C.
If a customer purchases 3 items he needs to to get 20% off on MRP and 2 products means 10% and if single product no discount.

Can any one help me in this using a excel formula.

Thanks in advance. Speed response is appreciated as it is urgent.



1 reply

Posts
2818
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
October 18, 2021
486
Kumanrc,

You could count the number of comma's:
=IF(ISERROR(SEARCH(",",B1)),"0%",IF(ISERROR(SEARCH(",",B1,SEARCH(",",B1)+1)),"10%","20%"))

Hopefully I was urgent enough.

Best regards,
Trowa