How to calculate Dimensions from a Text String in a single cell?

Viewed 68

I am need to calculate the dimensions from cell values that are entered as strings into a single cell vs. 3 separate cells and I do not want to break the dimensions into Length (L) x Width (W) x Height (H) Columns.. instead I am hoping there is a relatively simple function that would allow me to calculate the total cubic dimensions from that single cell.

I am aware of this tutorial that can take a string and be used to break it into 3 separate cells.. but that defeats the point of what I am trying to do.

My data looks like this:

Dimensions Cub/In. CF
70x13x13 11830 6.85
24*18*13 5616 3.25
24x16x12
16x24x10

Right now the data is entered as either "LxWxH" or "L*W*H" in that text formant and the columns that have values like the 5616 above are me manually re-entering "=24*18*13".. literally one character difference.

I did try a CONCATENATE to just append an "=" to the beginning but got errors on all in Google Sheets (for comparison) or a Literal string into processed as a formula in Excel. =CONCATENATE(“=”,B1)

enter image description here

Looking for a simple way to do this calculation in a single column and being able to have to enter the data once or utilize the existing data. I don't mind doing a single bulk replace of "x" to "*" on the input column to standardize the source column but don't want to have to do a series of bulk replaces every time I want to run through the data.

Thoughts?

1 Answers

Use SUBSTITUTE to get them all to the same, then use SPLIT and wrap in PRODUCT:

=PRODUCT(SPLIT(SUBSTITUTE(A2,"*","x"),"x"))

enter image description here

Or shorter Version shown by @JvdV:

=PRODUCT(SPLIT(A2,"*x"))
Related