+ Reply to Thread
Results 1 to 6 of 6

Using offset to chance reference

  1. #1
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Using offset to chance reference

    If I have the text of a column in a cell. For example, A5 (in cell A1). How can I use the offset formula to change than value. I tried referencing Offset(A1,,1) but it returns a #value error.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Using offset to chance reference

    the 1st ref in OFFSET tells excel where to start from (where the offset starts from)
    then how many rows to go down
    then how many columns to go down.

    If you have A5 as the reference you want to get info from, then you need to specify how rows to go down and how many columns to go across...
    =OFFSET(Star-Ref,rows, columns)

    You generally use values for the rows and column arguments, but a cell-ref can be used as well...
    A
    B
    1
    b5 abc
    2
    cba
    3
    4
    5
    abc cba


    B1=OFFSET(A1,RIGHT(A1,1)-1,0) This would be used when the column is the same (I changed it to B for the next example)
    B2=OFFSET(A1,RIGHT(A1,1)-1,CODE(LEFT(A1))-97)

    However, this seems a pretty long way around getting contents of a cell in a known location? Perhaps consider INDIRECT()?
    =INDIRECT(A1) = cba
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: Using offset to chance reference

    I'm going to work through your examples but I'm not sure I explained myself correctly. Spreadsheet attached.
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Using offset to chance reference

    You haven't provided very much information here. The formula is doing what you told it to do..

    =OFFSET (C$... start in cell C4 - which contains AM)
    ,, (stay in the same row)
    C2-1 (subtract 1 from the cvalue in C2 - 2 - which gives 1 and move that number of columns to the right of your startng point. That gives you E: the contents of D4, one row to the right of your starting point.

    What did you want as the answer... and why?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  5. #5
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: Using offset to chance reference

    The answers are in row 3. Based on the value in C2, change the column names in C3:E3 by that number minus 1. I have a spreadsheet that manually references months in another sheet, so when the month changes, I want to find and replace the column values. All the values in row 3 are for January. Maybe offset isn't the right formula.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Using offset to chance reference

    How about using INDIRECT()?

    C
    D
    E
    F
    G
    2
    2
    aa bb
    3
    AL D G
    4
    AM E H
    5
    E
    6
    0
    aa bb


    C6=INDIRECT(C3&$C$2)
    copied across

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. no chance to get hh.mm to work
    By blak24 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-05-2013, 06:06 AM
  2. Random Chance Formula?
    By MasterCoder84 in forum Excel General
    Replies: 2
    Last Post: 06-30-2010, 11:38 PM
  3. Second chance on a save
    By pprseller in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2009, 01:29 PM
  4. Chance of a number being selected
    By tinkerbelle in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-23-2006, 11:40 AM
  5. A better chance
    By leo31773 in forum Excel General
    Replies: 4
    Last Post: 09-13-2005, 10:54 AM

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