+ Reply to Thread
Results 1 to 2 of 2

Formula to return first valid cell in a range ignoring specific cell contents

  1. #1
    Registered User
    Join Date
    03-15-2012
    Location
    Liverpool
    MS-Off Ver
    Excel 2013
    Posts
    58

    Formula to return first valid cell in a range ignoring specific cell contents

    I need a formula that always looks at the first data cell in the range and returns this as long as it is not an ‘A’, or zero if the first cell is ‘A’ then the next valid cell to the right is displayed, if this too is an ‘A’ then it is the next cell to the right etc.

    2d, 3d,0,0……… the formula returns 2d
    0,0, 2d, 3d,0,0 ……… the formula returns 2d
    A, 2d, 3d, A,0,0 ……… the formula to return 2d
    A, A, 2d, 3d, A, 4a, 7f, 5r, A,0,0 ……… the formula to return 2d

    I need a formula that always looks at the first data cell in the range and returns this as long as it is not an ‘A’, or zero if the first cell is ‘A’ then the next valid cell to the right is displayed, if this too is an ‘A’ then it is the next cell to the right etc.

    There is a likelihood that a situation could arise where the data range contains something like:

    A, A,0,0,0,0,0,0,0,0,0,0,0, and I guess that as the formula will not allow the return an ‘A’ or a ‘0’ it would be good if rather than an error message it returned just a blank ie “ “
    Many thanks
    Last edited by Herr Rommel; 03-19-2012 at 02:52 PM.

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

    Re: Formula to return first valid cell in a range ignoring specific cell contents

    Try:

    =INDEX(A1:A10,MATCH(1,INDEX((A1:A10<>0)*(A1:A10<>"A"),0),0))

    adjust range to suit.
    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.

+ 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