+ Reply to Thread
Results 1 to 5 of 5

find the first value greater than one in a row

  1. #1
    Registered User
    Join Date
    11-17-2011
    Location
    Sri lanka
    MS-Off Ver
    Excel 2003
    Posts
    34

    Unhappy find the first value greater than one in a row

    i want to find the first value greater than one in a row and return the relevant column number of that cell.

    i found a function with INDEX and MATCH to do this task.but it doesn't work with the data table which i want.
    i have attached the relevant excel sheet here.
    in here that function works well with table 1.but it doesn't work with table 2.i couldn't understand what is the problem with it.
    please help me to find correct function and if you know the reason to failure my function let me know the reason for it

    thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: find the first value greater than one in a row

    hi rsami. did you know that your data contains spaces? spaces are considered to be greater than 0. try this instead:
    =INDEX($B$12:$AC$12,,MATCH(TRUE,ISNUMBER(B13:AC13),0))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    11-17-2011
    Location
    Sri lanka
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: find the first value greater than one in a row

    Quote Originally Posted by benishiryo View Post
    hi rsami. did you know that your data contains spaces? spaces are considered to be greater than 0. try this instead:
    =INDEX($B$12:$AC$12,,MATCH(TRUE,ISNUMBER(B13:AC13),0))
    Hi Benishiryo,
    thanks very much and it works perfectly.

    if you don't mind can you explain me what is the reason for it does not consider spaces in table 1 ?
    it gives the answer although there are spaces,are they consider as 0?

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: find the first value greater than one in a row

    you're very welcome. your Table 1 doesnt contain spaces. you can use these formula for eg:
    =LEN(B3)
    =LEN(B13)

    1st one will give you zero while the 2nd gives you 1. you can also copy B13 & press CTRL + F. then paste. you'll see a space. since spaces, texts & other symbols are considered to be greater than a number, your MATCH statement for >0 will give you TRUE for the very 1st column (the spaces found in column B)

    hope that helps

  5. #5
    Registered User
    Join Date
    11-17-2011
    Location
    Sri lanka
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: find the first value greater than one in a row

    Quote Originally Posted by benishiryo View Post
    you're very welcome. your Table 1 doesnt contain spaces. you can use these formula for eg:
    =LEN(B3)
    =LEN(B13)

    1st one will give you zero while the 2nd gives you 1. you can also copy B13 & press CTRL + F. then paste. you'll see a space. since spaces, texts & other symbols are considered to be greater than a number, your MATCH statement for >0 will give you TRUE for the very 1st column (the spaces found in column B)

    hope that helps
    i understood the situation.
    thanks very much again

    rep+

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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