+ Reply to Thread
Results 1 to 4 of 4

Formula to find a relative position for a value in a row

  1. #1
    Registered User
    Join Date
    06-08-2005
    Posts
    67

    Formula to find a relative position for a value in a row

    Say I have a series of values in a row. I need a formula that will return the relative position of the value in the row...and I will occasionaly insert a column at the front of the row of values, so the relative position may be different tomorrow.

    Foe example, say I have the following values in Row 1, columns B-F: 32,42,54,67,89
    Say in cell A2 is where I need my formula to return the relative position of the value for 54. Today the answer would be 3.
    Then say tomorrow I insert a new value (29) in Row 1, Column B...now I have values in columns B-G...so the relative position for 54 is now 4, which will now become the value in cell A2

  2. #2
    Forum Contributor
    Join Date
    04-01-2009
    Location
    Irvine, CA
    MS-Off Ver
    Excel 2010
    Posts
    280

    Re: Formula to find a relative position for a value in a row

    You could use the MATCH function:

    Please Login or Register  to view this content.
    Using the range of 1:1 allows you to add or delete columns and the -1 at the end accounts for column A (that you are not counting).

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula to find a relative position for a value in a row

    Try

    =Match(54,Index(A1:F1,1,2):F2,0)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula to find a relative position for a value in a row

    another is
    =MATCH(54,OFFSET(A1,,1,,255),0)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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