Calculate total Dimensions

%3CLINGO-SUB%20id%3D%22lingo-sub-2790431%22%20slang%3D%22en-US%22%3ECalculate%20total%20Dimensions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2790431%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20wonder%20if%20someone%20can%20help%20me.%20I%20export%20a%20spreadsheet%20for%20work%20that%20has%20a%20column%20containing%20dimensions.%3C%2FP%3E%3CP%3EWhile%20I'm%20at%20it%2C%20is%20there%20a%20way%20to%20calculate%20total%20weight%20as%20well%3F%20This%20one%20i%20normally%20can%20do%20but%20the%20%22KG%22%20text%20in%20the%20field%20is%20causing%20me%20some%20problems%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance!%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JonesyT_0-1632796749865.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F313241i0C193A918DB9CA1B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22JonesyT_0-1632796749865.png%22%20alt%3D%22JonesyT_0-1632796749865.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2790431%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2790720%22%20slang%3D%22en-US%22%3ERe%3A%20Calculate%20total%20Dimensions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2790720%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1168373%22%20target%3D%22_blank%22%3E%40JonesyT%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3ESelect%20cell%20range.%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3Eright%20mousekey%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3E%22Format%20cells%20...%22%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3ENumbers%20-%26gt%3B%20Category%20-%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3E%3CSPAN%3EClick%20%22Custom%22%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3EType%3A%20Standard%22%20KG%22%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3EOK.%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3EYou%20only%20need%20to%20enter%20the%20value%20and%20the%20value%20description%20is%20automatically%20displayed.%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%20class%3D%22%22%3E%3CSPAN%3EIn%20the%20inserted%20file%2C%20A2%3A%20A7%20is%20formatted%20in%20the%20same%20way.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20be%20happy%20to%20know%20if%20I%20could%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENikolinoDE%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWas%20the%20answer%20useful%3F%20Mark%20them%20as%20helpful!%3C%2FP%3E%3CP%3EThis%20will%20help%20all%20forum%20participants.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2790962%22%20slang%3D%22en-US%22%3ERe%3A%20Calculate%20total%20Dimensions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2790962%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1168373%22%20target%3D%22_blank%22%3E%40JonesyT%3C%2FA%3E%26nbsp%3BYou%20could%20use%20Find%20%26amp%3B%20Replace%20to%20get%20rid%20of%20the%20%22%20KG%22%20part%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESelect%20the%20column(s)%20with%20the%20weights%20in%20them.%20Ctrl-H%20to%20open%20the%20Find%20%26amp%3B%20Replace%20window.%20Type%20%22%20KG%22%20(i.e.%20a%20space%20and%20capital%20K%20and%20G)%20in%20the%20Find%20field.%20Leave%20the%20Replace%20field%20blank.%20Replace%20All%20and%20close%20the%20window.%20Now%20you%20should%20be%20left%20with%20numbers%20that%20you%20can%20calculate%20with.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202021-09-28%20at%2010.23.05.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F313293iB900753DE084053A%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Screenshot%202021-09-28%20at%2010.23.05.png%22%20alt%3D%22Screenshot%202021-09-28%20at%2010.23.05.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2791088%22%20slang%3D%22en-US%22%3ERe%3A%20Calculate%20total%20Dimensions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2791088%22%20slang%3D%22en-US%22%3EThank%20you%20both%20for%20these%20great%20responses.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20wasnt%20clear%20enough%20in%20my%20original%20post%2C%20but%20im%20also%20trying%20to%20work%20out%20how%20to%20calculate%20cubic%20meters%20for%20the%20'dimensions'%20coloumn%20and%20then%20total%20that%20as%20well%3F%3CBR%20%2F%3EIs%20that%20possible%3F%3C%2FLINGO-BODY%3E
New Contributor

Hi,

 

I wonder if someone can help me. I export a spreadsheet for work that has a column containing dimensions.

While I'm at it, is there a way to calculate total weight as well? This one i normally can do but the "KG" text in the field is causing me some problems

 

Thanks in advance!

JonesyT_0-1632796749865.png

 

 

5 Replies

@JonesyT 

Select cell range.

right mousekey

"Format cells ..."

Numbers -> Category -> Click "Custom"

Type: Standard" KG"  

OK.

 

You only need to enter the value and the value description is automatically displayed.

 

In the inserted file, A2: A7 is formatted in the same way.

 

I would be happy to know if I could help.

 

NikolinoDE

 

Was the answer useful? Mark them as helpful!

This will help all forum participants.

@JonesyT You could use Find & Replace to get rid of the " KG" part 

 

Select the column(s) with the weights in them. Ctrl-H to open the Find & Replace window. Type " KG" (i.e. a space and capital K and G) in the Find field. Leave the Replace field blank. Replace All and close the window. Now you should be left with numbers that you can calculate with.

Screenshot 2021-09-28 at 10.23.05.png

Thank you both for these great responses.

I wasnt clear enough in my original post, but im also trying to work out how to calculate cubic meters for the 'dimensions' coloumn and then total that as well?
Is that possible?

@JonesyT  You could Text-to-columns from the Data ribbon to split the Dimension text string. Use space as the delimiter and you will end up with something like this:

Screenshot 2021-09-28 at 11.25.20.png

Now you are all set to calculate volume from the numbers in columns with the numbers (in this case A, D and G).

 

Alternatively, go for a PowerQuery solution that you can use over and over again without having to split the dimensions column and enter formula and copy it down.

Screenshot 2021-09-28 at 11.41.20.png

An example is included in the attached file.

Hi @JonesyT 

There are different possibilities and I default to worksheet functions when reasonably possible;

Making the weights to number I'ld use 

=NUMBERVALUE(SUBSTITUTE(A2;" KG";"");".")

where substitute is to get rid of KG.

If you want to show the number as kilo, use @NikolinoDE guide to format the numbers with trailing unit.

 

The volume is a longer formula. Cleans the data, make it look like HTML and parse it as XML to finally calculate the volume.

The LET function returns whatever is on the last line (I used alt+enter to make new lines).

You may test the different parts by changing the last output eg to data or dataArrayNum 

 

=LET(range;C2;
data;SUBSTITUTE(range;" CM";"");
data_as_html;"<tr><td>" & SUBSTITUTE(data;" X ";"</td><td>") & "</td></tr>";
dataArrayText;transpose(FILTERXML(data_as_html;"//td"));
dataArrayNum;NUMBERVALUE(dataArrayText;".");
output;PRODUCT(dataArrayNum);
output
)