+ Reply to Thread
Results 1 to 6 of 6

If the IF function result is false then check the next cell until get a true result

  1. #1
    Registered User
    Join Date
    09-23-2015
    Location
    Leeds
    MS-Off Ver
    2007
    Posts
    3

    If the IF function result is false then check the next cell until get a true result

    Hello,

    I am trying to use the IF function to return names from column A where column B ="R". I need to remove the false or blank cells where column B does not = "R" so I just have the appropriate names (I know I could just filter but I need this to be automated in another sheet)

    eg
    Original Data
    Column A Column B
    1 Mike R
    2 Stephen
    3 Lisa R
    4 Graham
    5 Sarah
    6 Nicola R


    What If Returns
    Column A
    1 Mike
    2
    3 Lisa
    4
    5
    6 Nicola


    What I want
    Column A
    1 Mike
    2 Lisa
    3 Nicola


    Hope this makes some sense to someone!!!

    Thanks in advance
    Last edited by Beag air Bheag; 06-10-2017 at 07:35 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: If the IF function result is false then check the next cell until get a true result

    In D2, an array-entered formula, copied down:

    =IFERROR(INDEX(A:A,SMALL(IF($B$2:$B$7="R",ROW($B$2:$B$7)),ROWS(D$2:D2))),"")

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: If the IF function result is false then check the next cell until get a true result

    datasheet:
    c1="R"&countif($B$1:$B1,$B1) and drag down


    sheet result:
    a1=IFERROR(INDEX(datasheet!$A$1:$C$6,Match("R"&ROW(),datasheet!$C$1:$C$6,0),1),"") and drag down
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Registered User
    Join Date
    09-23-2015
    Location
    Leeds
    MS-Off Ver
    2007
    Posts
    3

    Re: If the IF function result is false then check the next cell until get a true result

    Brilliant, this has done exactly what I was looking for!

    Thank you very much Glenn Kennedy!
    Last edited by Beag air Bheag; 06-10-2017 at 08:51 AM.

  5. #5
    Registered User
    Join Date
    09-23-2015
    Location
    Leeds
    MS-Off Ver
    2007
    Posts
    3

    Re: If the IF function result is false then check the next cell until get a true result

    Thanks oeldere, the solution posted by Glenn has worked so I'm going to stick with that! But I appreciate you responding.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: If the IF function result is false then check the next cell until get a true result

    You're welcome and thanks for the rep.

+ 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. Can Excel operate a function based on a true or false result?
    By StinkeyPete in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-06-2005, 07:05 PM
  2. [SOLVED] Can Excel operate a function based on a true or false result?
    By StinkeyPete in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-06-2005, 05:05 PM
  3. [SOLVED] Can Excel operate a function based on a true or false result?
    By SteveD in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  4. [SOLVED] Can Excel operate a function based on a true or false result?
    By StinkeyPete in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 05:05 AM
  5. Can Excel operate a function based on a true or false result?
    By SteveD in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 AM
  6. Can Excel operate a function based on a true or false result?
    By SteveD in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  7. Can Excel operate a function based on a true or false result?
    By SteveD in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  8. [SOLVED] Can Excel operate a function based on a true or false result?
    By SteveD in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-26-2005, 09:05 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