Lookup?

ZSandman

New Member
Joined
Nov 4, 2002
Messages
20
Hello. This involves expense data downloaded from SAP into Excel. The data has cost codes associated with it. Data can be pulled in for preset departments, but it doesn't (yet) allow one to selectively pick different departments and download to the same spreadsheet. So, they are downloaded separately and pasted together. The problem is that the cost codes don't line up across rows as departments can have different types of expenses. They all though come from the same master list and which can be obtained by putting the total company expenses in the spreadsheet. Codes will not always be in sequential order.

The ordering of the cost costs and subtotals are predetermined. I've created a sample with the data correctly pasted from Dept A on the right into the desired row. The exception occurs on the row with Code 12367 for which there is no corresponding code on the right and the cell needs to be blank. How can I match up the codes on the right with those on the left and paste a value? I've tried VLOOKUP and some misguided routes, but haven't succeeded. Any and all input welcome. Thanks.

------------------------------Copied
----------------Total Co.----Dept A---------------------------Dept A
Code----------Expense-----Expense-------Code-----------Expense
12345------------112-----------50----------12345------------50
12348------------138-----------12----------12348------------12
12367------------112---------BLANK--------12403------------25
12403------------115-----------25---------12408-------------35
12408------------217-----------35---------Subtotal----------122
Subtotal----------694----------122
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,203,558
Messages
6,056,078
Members
444,844
Latest member
Taps07

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