+ Reply to Thread
Results 1 to 8 of 8

Lookup with offset

  1. #1
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Lookup with offset

    Hi guys

    Please see the attached spreadsheet. What I am trying to do is this "If G1= A, then G2:H13 = A2:B13 If G1 = B then G2:H13 = B16:B27 and the same for C and D

    I am trying this formula below but to no avail. Any ideas? thanks

    =IF(G1="A",OFFSET(_BlockA,0,0,1,COLUMNS(_BlockA))
    Attached Files Attached Files
    Blake 7

    If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

    If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.

    http://failblog.org/

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Lookup with offset

    Hi Blake.

    An easy way to do this, IS USING 4 if.

    In G2 and copy down and right.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Lookup with offset

    How about

    =CHOOSE(CODE($G$1)-64,A2,A16,A30,A44)

  4. #4
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Lookup with offset

    Guys, thanks both for your input. Very kind of of you. Re the -64 bit of this formula =CHOOSE(CODE($G$1)-64,A2,A16,A30,A44) . What is the role opof -64 here?

    Thnkas

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Lookup with offset

    the code number for character A is 65 so you subtract 64 to get 1,2,3,4 for your choose function.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Lookup with offset

    Impressive! I did not know that. Never until now I had not seen.

    So thank you, Cutter, that showed us and of course you, Joseph that explain it, to us.

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Lookup with offset

    Glad to help.

    Hey Blake 7, where have you been? Haven't seen you around very much?

    Edit: Blake 7 and Fotis1991, thanks for the 'star taps'.
    Last edited by Cutter; 05-04-2012 at 10:05 AM.

  8. #8
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Lookup with offset

    Hey Cutter. I have never been so busy! I have my main job mon - fri 9-5 and then eves and weekends I lease a kitchen in a sports bar and cook!! i simply dont have time. Plus my boss sits next to me at work!!! Thanks for your help and good to hear from you.

    Just out of interest IF the A B C and D were 1,2,3 and 4 how would I approach this? =CHOOSE({1,2,3,4},A2,A16,A30,A44) didnt seem to work neither did =IF($G$1="1",A2,IF($G$1="2",A16,IF($G$1="3",A30,IF($G$1="4",A44,""))))

    Cheers fellas
    Last edited by Blake 7; 05-04-2012 at 11:25 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1