Number Formatting in a cell with a formula

tonyjyoo

Board Regular
Joined
Aug 5, 2016
Messages
167
Hello,

I have cells in column A that are directly linked to other cells in a different tab.

For example, cell A1 =
Code:
='Tab2'A1

However, I am trying to keep the number formatting so that my numbers have a leading 0 (8 digits total).

For example, "920" should be reading "09200000". However, because the cell is a formula, it is spitting out "9200000". When I type it manually, the number format shows correctly.

Any thoughts as to how to approach this?

Thanks.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi Tonyjyoo,

I'm wondering how you write 920 and get 9200000?

With a custom format as 00000000 I get 00000920 when I write 920.

Vandalo
 
Upvote 0
Hi Tonyjyoo,

I'm wondering how you write 920 and get 9200000?

With a custom format as 00000000 I get 00000920 when I write 920.

Vandalo

Sorry, I meant to say I'm writing "9200000", and it should be giving me "09200000", but if the cell has a formula, it only reads as "9200000", ignoring my number format.
 
Upvote 0
Sorry, I meant to say I'm writing "9200000", and it should be giving me "09200000", but if the cell has a formula, it only reads as "9200000", ignoring my number format.
Number formats are only applied to numbers, not text (or text entered like numbers). So you need to coerce your formula to return a number, and not text.

If your formula is:
Code:
='Tab2'A1
one way to coerce it to a number would be like this:
If your formula is:
Code:
='Tab2'A1 * 1
 
Upvote 0
Number formats are only applied to numbers, not text (or text entered like numbers). So you need to coerce your formula to return a number, and not text.

If your formula is:
Code:
='Tab2'A1
one way to coerce it to a number would be like this:
If your formula is:
Code:
='Tab2'A1 * 1


Absolutely brilliant. This is exactly what I was looking for.

Thank you!
 
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,438
Members
449,083
Latest member
Ava19

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