Format Cells: Create custom prefix that will work on both number and text

Shins83

New Member
Joined
Mar 15, 2017
Messages
5
I need to create a custom prefix that will work with cells that contain both number only and number and text data. I've used "000-0"#### but that only works with number only cells. I've also tried "000-0"@ but it only displays the text. There must be a simple solution I can't think of!

Many thanks
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I need to create a custom prefix that will work with cells that contain both number only and number and text data. I've used "000-0"#### but that only works with number only cells. I've also tried "000-0"@ but it only displays the text. There must be a simple solution I can't think of!
Side note - You do not need multiple # signs unless you want to specify a thousands separator.

This Custom Format will work for positive numbers and text (you did not say what to do for zero or negative values, so I assumed they were not possible)...

"000-0"#;;;"000-0"@
 
Upvote 0
I have another question that has issues with the above solution. I've mirrored my main table into another sheet by using Data > Get External Data From Other Sources > From Microsoft Query > Excel Files. The column with serial numbers in, the Query table only shows values with only number values (i.e. 000-01234 is shown, but where 000-01ab2 should be, the cell is blank). Any idea on how I would get the Query table to show all data?

Many thanks
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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