question about concatenating

scotthannaford1973

Board Regular
Joined
Sep 27, 2017
Messages
110
Office Version
  1. 2010
Platform
  1. Windows
Hi folks
hope you can help here.

in C1 I have a cell value with a prefix added through the number format, so the number is 1, but the number format is: "PE"-2021-000 so that 1 shows as PE-2021-001

in D1 I have some text, say "Project name".

I want, in E1, to concatenate C1 and D1 to give me PE-2021-001 Project Name

Unfortunately, concatenating ignores the number format so I just end up with 1 Project Name

I have tried using TEXT and LEFT but cannot get the concatenated cell to show all of the contents of C1.

Help!

TIA
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

that might help. I have not tried it, but the format arg should do what you are after without having to hand code the formatting. that would be doable, but might be more of a PITA than it would/could be worth.
 
Upvote 0
Number formatting is a façade and only changes how the number is displayed not the number. When you concatenate you are only acting on the number. You would need to concatenate PE-2021-00 along with project name.
Code:
="PE-2021-00"&C1&" "&D1
 
Upvote 0
How about
="PE-2021-"&TEXT(C1,"000 ")&D1
 
Upvote 0
Thanks, Scott - that's okay when the number is 1, but (and I forgot to add!) below the 1 the numbers count up to 100, so I have PE-2021-001 down to PE-2021-100; using the standard formula you suggest, I'd get PE-2021-00100 rather than PE-2021-100

thanks, though - my mistake for not mentioning that.

Count Tepes - thanks, that works perfectly
 
Upvote 0
Yup Scott T has it correct, that was what I was attempting to avoid. Sadly after trying the link I provided, that is NOT the correct process. Sorry that only provides what the cell its, not the desired output of the cell formatting. le sigh.
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,378
Members
448,955
Latest member
BatCoder

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