multiple conditions recoding

bwhamilton

New Member
Joined
Dec 18, 2008
Messages
29
hey guys.

I have a column with a bunch of promotion types that have to be recoded to a specific format. I can think of a few ways to do it by using if statements in a macro, but no way to basically count the number of entries within a cell (i.e. buy one get one free, rebate, loyalty card = BOGO + 2 other promos).

for example:
A cell may contain: 50% Off, Loyalty Card Required, Other Purchase Required / Buy/Get - Other, Loyalty Card Required

This cell would have to get recoded Discount + 3 other promotions (3 entries separated by commas after the initial entry of 50% off).

I dont know if this makes sense, but I could really appreciate any help.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Do you need a macro or will a formula do?

Assuming that text in A1:

=IF(A1="","","Discount + " &LEN(A1)-LEN(SUBSTITUTE(A1,",","")) &" other promotions")
 
Upvote 0

Forum statistics

Threads
1,214,821
Messages
6,121,762
Members
449,048
Latest member
excelknuckles

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