Formatting Tiered Budget Sheet to combine parts of account numbers

TheyCallMeNerd

New Member
Joined
Dec 13, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello

Recently I have started in a new position. I am an intermediate to advanced user of Excel and my VBA skills are minimal at best. So, I would like to avoid VBA if at all possible.

On to the question: I have a spreadsheet that is set up with account codes with the following format: ##-####-#### Department/Division/Account.

Department Division Account
Column A Column B Column C Desired Results(Column D)
00 0000 0000 00-0000-0000
1111 00-0000-1111
2222 00-0000-2222
1111 0000 00-1111-0000
1111 00-1111-1111
2222 00-1111-2222
3333 00-1111-3333
4444 00-1111-4444
01 0000 0000 01-0000-0000
1111 01-0000-1111
2222 01-0000-2222
1111 0000 01-1111-0000
1111 01-1111-1111
2222 01-1111-2222

I would like to create a formula that will concatenate all of these into the above listed format? Is this even possible? The information is a data dump from Report Server.

I do believe it would be nested IFS Statement. It is the lookup part that I am not sure which would be best. Index/Match or VLookup or XLookup. Any input would be greatly appreciated!
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Welcome to the MrExcel board!

As you can see, your sample has lost all its formatting. For the future, investigate the following
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

See if this is what you want.

21 12 13.xlsm
ABCD
1DeptDivAcResult
2000000000000-0000-0000
3111100-0000-1111
4222200-0000-2222
51111000000-1111-0000
6111100-1111-1111
7222200-1111-2222
8333300-1111-3333
9444400-1111-4444
10010000000001-0000-0000
11111101-0000-1111
12222201-0000-2222
131111000001-1111-0000
14111101-1111-1111
15222201-1111-2222
Combine
Cell Formulas
RangeFormula
D2:D15D2=TEXTJOIN("-",,LOOKUP("z",A$2:A2),LOOKUP("z",B$2:B2),C2)
 
Upvote 0
Welcome to the MrExcel board!

As you can see, your sample has lost all its formatting. For the future, investigate the following
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

See if this is what you want.

21 12 13.xlsm
ABCD
1DeptDivAcResult
2000000000000-0000-0000
3111100-0000-1111
4222200-0000-2222
51111000000-1111-0000
6111100-1111-1111
7222200-1111-2222
8333300-1111-3333
9444400-1111-4444
10010000000001-0000-0000
11111101-0000-1111
12222201-0000-2222
131111000001-1111-0000
14111101-1111-1111
15222201-1111-2222
Combine
Cell Formulas
RangeFormula
D2:D15D2=TEXTJOIN("-",,LOOKUP("z",A$2:A2),LOOKUP("z",B$2:B2),C2)
Oh my goodness! With the holidays, I totally forgot to respond! Thank you for the response and the tidbits. I will definitely use it in the future.
 
Upvote 0

Forum statistics

Threads
1,214,648
Messages
6,120,726
Members
448,987
Latest member
marion_davis

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