SOLVED

Formula help: if two cells match on different sheets, display value of adjacent cell...

Copper Contributor

Couldn't quite explain this in the title.... perhaps best just show an example.

 

Sheet 1:

Sheet1.png

Here I have the "ledger codes", which are also shown next to each transaction on Sheet 2.

 

Sheet 2:

Sheet2.png

I really need the "type" for each code to be shown on Sheet 2. On my real spreadsheet, there are hundreds of codes, and I've put them into larger categories (just like I have done with the "BB" codes all going under "Overheads" here).

 

So, is there a formula I can use to populate Sheet 2, Column B with the text from Sheet 1, Column B, using the codes in column A to show the correct category?

 

For example: using a single formula in Sheet 2, cell B2 and dragging it down all the rows to the bottom should leave all the cells next to "AA100" and "AA105" with the text "Income", all the codes starting "BB" should say "Overheads" in column B, and so on.

 

I would really appreciate any help here - it's all just a bit over my head!

 

Thanks in advance,


Eddie

 

 

3 Replies
best response confirmed by Hans Vogelaar (MVP)
Solution

@RSS_2022 

=VLOOKUP(A2,sheet1!$A$1:$B$7,2,FALSE)

 

Maybe with vlookup as shown in the attached file. With Office365 or 2021 you can use xlookup as well.

 

@OliverScheurich 

 

I'll try that when I'm back in the office tomorrow... for now I just wanted to say thank you very much. The "SVERWEIS" had me confused for a second... vielen Dank!

 

I don't have xlookup as we're still on Office 2016, but hopefully I'll be able to pretty much paste the code and get the results!

@OliverScheurich 

It worked a charm, thanks again! Saved me a lot of time. I'm sure the question has been answered before, but I didn't know how to search for it, so I'm very grateful for your help.

1 best response

Accepted Solutions
best response confirmed by Hans Vogelaar (MVP)
Solution

@RSS_2022 

=VLOOKUP(A2,sheet1!$A$1:$B$7,2,FALSE)

 

Maybe with vlookup as shown in the attached file. With Office365 or 2021 you can use xlookup as well.

 

View solution in original post