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

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
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.

[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]Data[/TD]
[TD="align: center"]Quantity in Figures[/TD]
[TD="align: center"]Unit of Measure[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]1,200 KG[/TD]
[TD="align: center"]1,200[/TD]
[TD="align: center"]KG[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]5,000 CS[/TD]
[TD="align: center"]5,000[/TD]
[TD="align: center"]CS[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]0.500 G[/TD]
[TD="align: center"]0.500[/TD]
[TD="align: center"]G[/TD]
[/TR]
</tbody>[/TABLE]

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,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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