Extracting units from Custom Format

x_marx_dspot

New Member
Joined
Mar 27, 2014
Messages
10
Hi,

Good day!

I have a column of figures with several units attached to it via custom format, e.g. KG, PC, G, CS, etc.

I would like to extract the units onto another column, showing only the units using formula only.

I've tried the =cell("format",XX) function but it seems to return ",0" figures.

Thanks!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
If the cell has a number format applied to it the underlying value doesn't change so you should be able to refer to it in a formula without any parsing.
 
Upvote 0
If the cell has a number format applied to it the underlying value doesn't change so you should be able to refer to it in a formula without any parsing.

Hi Andrew,

Thanks for the reply, yes, it has a format applied to it. Would you have a formula to extract the units under the custom format? Thanks!
 
Upvote 0
Here is a sample table.

ABC
1DataQuantity in FiguresUnit of Measure
21,200 KG1,200KG
35,000 CS5,000CS
40.500 G0.500G

<tbody>
</tbody>

Thanks!
 
Last edited:
Upvote 0
Oh I see. You want to extract the unit of measure not the value. That would require VBA, using the NumberFormat property.
 
Upvote 0
Well you could use the old GET.CELL function.

Simple explanation to suit data set up in sample, select cell C2 and CTRL-F3 to add defined name "CellContent" with formula =get.cell(53,a2)
Then in cell C2 enter the formula =mid(CellContent,FIND(" ",CellContent)+1,255)

Or some variation of that. Could put it all in a defined name, for example. cheers
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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