Forum Discussion

Lorraine McGadey's avatar
Lorraine McGadey
Copper Contributor
Sep 14, 2018

vlookup

I want to automate my vlookup formula to flick between 2 different tabs (Budget and Actual) by referencing one cell that I can change depending on my requirements

1 Reply

  • Philip West's avatar
    Philip West
    Steel Contributor

    You could try something like this:

     

    =VLOOKUP(A1,INDIRECT($B$1 & "!A3:D14"),2,TRUE)

     

    Where A1 is what you are looking up, B1 is the name of the sheet you want to look it up on and A3:D14 is range on those two sheets where the info would be to look it up in.

     

    If you need more flexabilty over where your look up data is you could use 1 extra cell, whereby lets say in C1 (or wherever it doesn't matter) you have some logic that takes your choice in B1 and writes out the full range info. So you wright budget, and c1 says Sheet2!A1:H7

     

    In which case the look up would read =VLOOKUP(A1,INDIRECT($C$1),2,TRUE)

Resources