Breakout numbers from a string and use/store each number as a variable

mmmaxmmm

New Member
Joined
Apr 13, 2017
Messages
14
So I've got a bunch of cells going down column A with strings like the below examples and I would like to be able to use each number in an IF function. Is there a way to store each number in A1 as a variable that I can use in an IF function and then once all the numbers are stored and used, move on to the next cell A2 and do the same thing? So 1 would be stored as a variable, used in an IF function. Then 25 would be stored as a variable, used in an IF function, then 50. Then it would reset or something, move on to A2 and start looping it like that through the end of column A. If anyone can post code, the IF function could just be the most simplest thing you can think of. My issue here is all the other stuff, not the IF function. Thank you to anyone who may be able to help!




A1 might have this as text: 1CA/25EA/50
A2 might have this as text: 1CA/100EA/5000PR/1000
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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