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

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
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,211,744
Messages
6,103,678
Members
447,876
Latest member
rodqntr

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