+ Reply to Thread
Results 1 to 4 of 4

Returning a number from multiple matches possible

  1. #1
    Registered User
    Join Date
    08-03-2011
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Returning a number from multiple matches possible

    I am trying to write a formula that looks to see if cell A4=1 and if it is to return the value of cell B4. That part is easy, my issue is that if cell A4 is not value 1 then I want it to look at cell A5 and see if it is 1 and return the value in cell B5 if it is, if not go to A6 and see if it equals 1, if yes then return value of B6 else look at A7 etc...

    Any ideas?

  2. #2
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: Returning a number from multiple matches possible

    Welcome to the forum, Jeff.

    Try this formula:

    =INDEX(B4:B10,MATCH(1,A4:A10,0))


    If it doesn't find a 1 in any of the cells then it will return a #N/A error.

    Another way to do this is with VLOOKUP:

    =VLOOKUP(1,A4:B10,2,0)
    Hope that helps,

    Colin

    RAD Excel Blog

  3. #3
    Registered User
    Join Date
    08-03-2011
    Location
    PA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Returning a number from multiple matches possible

    Where is the B10 coming from in the vlookup formula?

  4. #4
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: Returning a number from multiple matches possible

    Your values are in A4 through to Bx, where x is the last row. You didn't tell me where the last row of data was, so I guessed at 10 for my example. If the 1 might be found up to A100, then change to B100.

+ 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