Extract and Sum certain numbers from a cell that contains both text and numbers I don't need

BethLivingston

New Member
Joined
Jun 28, 2021
Messages
3
Office Version
  1. 365
  2. 2013
HI all. This is my first post here.
I have a client who is a retail furniture store and I am importing their POS export to their web store.
The POS system exports the inventory by showroom but all in one cell like this:

6/12SHW;1/16SHW;1/16SHW;1/16SHW;3/16SHW;6/13SHW;1/14SHW;1/14SHW;1/14SHW;1/14SHW;1/14SHW;1/14SHW;
or this

1/16SHW;1/12SHW;1/13SHW;

The number before the / is the inventory at that showroom. The number and text between the / and the semi-colon is the showroom number.
I need to extract only the numbers before the / and sum them to get the total inventory for that product.

I've searched for a solution and there seems to be one. I just can't figure out how to put the various functions together to make this work.

Any ideas?
Thanks in Advance
Beth
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Assuming your value is in cell A1 and further assuming the entry in that cell will not be longer than 300 characters and that the maximum number of inventory items in that cell is 25, then this formula will return the sum of all the number in front of a slash...
Excel Formula:
=SUMPRODUCT(0+(0&TRIM(MID(SUBSTITUTE("/"&SUBSTITUTE(A1,";","/"),"/",REPT(" ",300)),(2*ROW(1:25)-1)*300,300))))
Note: The assumptions I made (since you didn't give us a hint, I had to guess) can be modified within certain limits if needed.
 
Upvote 0
Thank you Rick,
That works. However, when I copy the formula to the cells below, it changes the value in the (2*ROW(1:25) part to (2*ROW(2:26), (2*ROW(3:27) and so forth which screws up the calc. Is there a way I can copy this to the subsequent rows without having that happen? Today I am testing with 300 products but when I actually do this it will be thousands of products so changing this manually in each cell would be a bear.

Thanks so much for your help!
 
Upvote 0
What happened to my $ signs? I've noticed that under certain modifications to formulas, Excel drops $ signs from range references. I haven't figured out what those conditions are though. My original formula had them and I did not think to look to see if they were still there. Here is the formula the way I intended to post it...
Excel Formula:
=SUMPRODUCT(0+(0&TRIM(MID(SUBSTITUTE("/"&SUBSTITUTE(A1,";","/"),"/",REPT(" ",300)),(2*ROW($1:$25)-1)*300,300))))
 
Upvote 0
Solution

Forum statistics

Threads
1,214,858
Messages
6,121,960
Members
449,057
Latest member
FreeCricketId

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