+ Reply to Thread
Results 1 to 10 of 10

A function which search in the row

  1. #1
    Forum Contributor
    Join Date
    01-16-2015
    Location
    Istanbul
    MS-Off Ver
    Office 365
    Posts
    928

    A function which search in the row

    Is there a function which search in the row (cells on the right of the formula cell) and find non-blank cell?

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: A function which search in the row

    What do you want to do with the information?
    This formula returns the position of the first non-blank cell within B1:J1
    Please Login or Register  to view this content.
    This formula returns the value of the first non-blank cell in that range
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: A function which search in the row

    It should be noted that Ron's formulas only work on TEXT data. Won't work on numeric data.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: A function which search in the row

    Good catch, Biff...Thanks!

    These would work for either text or numeric entries and would ignore text blanks....""
    Please Login or Register  to view this content.

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: A function which search in the row

    This will work with numbers and text

    =INDEX(B1:J1,MATCH(TRUE,INDEX((B1:J1<>0),),))
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: A function which search in the row

    Quote Originally Posted by AlKey View Post
    This will work with numbers and text

    =INDEX(B1:J1,MATCH(TRUE,INDEX((B1:J1<>0),),))
    Just being the nit picker that I am...

    What if 0 is a valid entry?

  7. #7
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: A function which search in the row

    Slight tweak so that formula won't ignore zeros.
    Please Login or Register  to view this content.
    (I'm not a fan of omitting the 3rd argument of MATCH of the 2nd/3rd arguments of INDEX...I never remember what the default is :\ )

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: A function which search in the row

    Quote Originally Posted by Tony Valko View Post
    Just being the nit picker that I am...

    What if 0 is a valid entry?
    Well, since I am not totally blind, in case there are zeros, I would use <>""

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: A function which search in the row

    Quote Originally Posted by Ron Coderre View Post

    (I'm not a fan of omitting the 3rd argument of MATCH of the 2nd/3rd arguments of INDEX...I never remember what the default is :\ )
    +1

    Although, I'm guilty of the same WRT the OFFSET function...

    =OFFSET(A1,,,5)

  10. #10
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: A function which search in the row

    Well, for that matter, so am I
    ...but OFFSET doesn't try to match anything one way or another, based on an argument.

+ 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. [SOLVED] Set VBA search function to only search one row and also not show duplicates?
    By TomToms in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-05-2014, 04:00 PM
  2. How to search 2 criteria using this search function?
    By puuts in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2014, 04:25 PM
  3. IF(count(search) Function not working when search from text from a cell
    By joshnathan in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-09-2013, 05:13 AM
  4. [SOLVED] Search function to search if worksheet contains specified text
    By mougiasm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-07-2013, 02:50 PM
  5. Replies: 1
    Last Post: 10-18-2012, 05:52 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