+ Reply to Thread
Results 1 to 9 of 9

Check next row if value is, "FALSE," if "TRUE," return specified value from this row

  1. #1
    Registered User
    Join Date
    01-19-2015
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    3

    Check next row if value is, "FALSE," if "TRUE," return specified value from this row

    Hi,

    Completely new here, I've been browsing for a solution, but can't quite find what I'm looking for. I'd be incredibly grateful if anyone could help me get under way.

    I've attached a mock-up of what I am working on to compliment the description:

    I have a, "desired_value," on table 1. There is another column within table 1 that is set to either "true" or "false."

    In table 2, I require the "desired_value" of all rows that are marked "true" from table 1 in a sequential list, with no spaces or zeroes.

    If possible I'd like to achieve this without using a macro.

    Thanks, and looking forward to your support,

    Dave
    Attached Files Attached Files

  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,063

    Re: Check next row if value is, "FALSE," if "TRUE," return specified value from this row

    Lots of ways of doing this... here's one It's an array formula, which is confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    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 Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Check next row if value is, "FALSE," if "TRUE," return specified value from this row

    =IFERROR(INDEX(source_data!A:A,SMALL(INDEX((Table1[check]<>TRUE)*10^10+ROW(Table1[check]),0),ROW(1:1))),"")
    Try the above in A2 and copy towards down
    or
    Use Pivot Table
    Attached Files Attached Files
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Registered User
    Join Date
    01-19-2015
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    3

    Re: Check next row if value is, "FALSE," if "TRUE," return specified value from this row

    Thanks, both great responses.

    Could I ask for a quick breakdown of the logic for each? I became a little lost when we began using the ROW function, and it would be great if I could understand this and be able to adapt it myself in future projects. In particular:

    "INDEX((unit_equipment_editor[has_stat]<>TRUE)*10^10+ROW(unit_equipment_editor[has_stat]),0),ROW(9:9))),"")"

    This part of Siva's formula.

    Not sure if this is the correct etiquette here, so please excuse me if I am asking too much

    Anyway, I would consider this problem solved for now, so again - a huge thanks for the quick replies!

    Dave

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Check next row if value is, "FALSE," if "TRUE," return specified value from this row

    Quote Originally Posted by Glenn Kennedy View Post
    Lots of ways of doing this... here's one It's an array formula, which is confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    Hi Glen this is for you
    Attached Files Attached Files

  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,063

    Re: Check next row if value is, "FALSE," if "TRUE," return specified value from this row

    "My" formula returns the desired values INDEX(Table1[desired_value] by: ROW(Table1[check])-1) checking which row number have got TRUE in them IF(Table1[check]=TRUE,
    and returning the value in the ascending order of row number SMALL.... Row(1:1)..

    Clear as mud??

  7. #7
    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,063

    Re: Check next row if value is, "FALSE," if "TRUE," return specified value from this row

    Siva, you're a star. It was the "+" which had me struggling!!!

  8. #8
    Registered User
    Join Date
    01-19-2015
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    3

    Re: Check next row if value is, "FALSE," if "TRUE," return specified value from this row

    Awesome!

    Yes, that seems to make sense. I guess part of the battle is just knowing the different steps in logic you can take. I'll definitely be using this again in the future, so thanks again :D

  9. #9
    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,063

    Re: Check next row if value is, "FALSE," if "TRUE," return specified value from this row

    You're welcome & thanks for the Reputation.

+ 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. compare two excel sheets using macros and display the result in "true" or "false"
    By gayunana01 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-09-2012, 07:21 AM
  2. VLookup to return "true" or "false"
    By Sph01 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-29-2011, 11:10 AM
  3. Replies: 5
    Last Post: 10-12-2010, 06:46 AM
  4. Replies: 7
    Last Post: 05-13-2006, 05:02 PM
  5. [SOLVED] IF(VLOOKUP("MYDATA", MYNAME, 4) = 0, "TRUE", "FALSE")
    By Souris in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2005, 01: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