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.
 

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
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")
 

Watch MrExcel Video

Forum statistics

Threads
1,123,385
Messages
5,601,331
Members
414,446
Latest member
CRAVIN

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