Format data when combining in another cell

Askjerry

New Member
Joined
May 5, 2011
Messages
25
Here is an interesting one... I need to create a file name... it uses several fields to make one value.


Consider something like this...

Code:
Cell           Data               Info
--------------------------------------------------------------------------------------------------------------
[B]A1          [/B]    Widget          (Format: Text,  Item name, text)
[B]A2[/B]             0                         (Format: A number 0 to 999, the cell is formatted as "000" so it always shows 3 characters.)
[B]A3[/B]             B                          (Format: Text,   A product code, A through D)

So I should be able to make cell A4 into the file name like this...

In-Cell formula follows....

= A1 &"-" & A2 &"-" & A3

I would expect cell A4 to show : "Widget-000-B" but what I get is "Widget-0-B" which is incorrect. :(

So... instead of "A2" in the formula above... I need something to tell it the number should have three (3) characters...

How do I do that? (From in the cell... without VBA.)

Thanks,
Jerry
 
Last edited:

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Ah... that worked perfectly... there are some other uses I can see for that trick too... thanks!
(I'll take a closer look at the command to see what else it does.)
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
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