+ Reply to Thread
Results 1 to 18 of 18

Formula to return as true or false

  1. #1
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Formula to return as true or false

    =INDEX(Table1[Source]:Table1[Source],MATCH(1,($A6=Table1[ID]:Table1[ID])*($B$3=Table1[StartDate]:Table1[StartDate]),0))

    Is it possible to get results as true or false from the above formula

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,924

    Re: Formula to return as true or false

    In what sense? What would you want to see returned from the formula to trigger a TRUE response? If it's the word "banana", try this:

    =INDEX(Table1[Source]:Table1[Source],MATCH(1,($A6=Table1[ID]:Table1[ID])*($B$3=Table1[StartDate]:Table1[StartDate]),0))="Banana"
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: Formula to return as true or false

    Since your formula is contained in an INDEX() your formula is returning a value.
    To determine if the result is TRUE or FALSE you need to define what value it should be for TRUE (at least).
    Over to you...
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Formula to return as true or false

    Like if a match is found, then true, otherwise false? If so, wrap your formula in a IF: =IF(iserror(your formula),"false","true")
    Click the * to say thanks.

  5. #5
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Formula to return as true or false

    I tried...

    =IF(AND($A21=Table1[ID]:Table1[ID],$B$15=Table1[StartDate]:Table1[StartDate]),"True","False")
    but I get "False" for all

    I just want to check cells A21=Table1[ID] and B15=Table1[StartDate]

  6. #6
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Formula to return as true or false

    I think that you want to check if these two are match: =IF(AND(VLOOKUP($A21,Table1[ID]:Table1[ID],1,0),VLOOKUP($B$15,Table1[StartDate]:Table1[StartDate],1,0)),"True","False")

  7. #7
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Formula to return as true or false

    You are right PaulM

    I am getting #REF error from the following formula :

    =IF(AND(VLOOKUP(Calendar!$A21,Table1[ID]:Table1[ID],14,0),VLOOKUP(Calendar!$B$15,Table1[StartDate]:Table1[StartDate],8,0)),"tr","fa")

  8. #8
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: Formula to return as true or false

    A #REF error on a VLOOKUP suggests you are trying to retrieve a column that's beyond the range that is being looked up, e.g.

    VLOOKUP(A1,B1:C100,3,0)

    returns #REF because the range B1:C100 is only 2 columns wide yet column 3 is trying to be returned.

    Check your table ranges, make sure there are 14 and 8 columns to retrieve from the tables respectively.

  9. #9
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Formula to return as true or false

    Hmmmm...

    I extended the range from first to last and made sure columns are 14 and 8 to retrive

    I get #N/A for this formula
    =IF(AND(VLOOKUP(Calendar!$A21,Table1[Ref]:Table1[Email],14,0),VLOOKUP(Calendar!$B$15,Table1[Ref]:Table1[Email],8,0)),"tr","fa")

    I tried only one column ...then I get #VALUE error
    =IF(AND(VLOOKUP(Calendar!$A21,Table1[ID]:Table1[ID],1,0),VLOOKUP(Calendar!$B$15,Table1[StartDate]:Table1[StartDate],1,0)),"tr","fa")

  10. #10
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: Formula to return as true or false

    There's no error trapping in your AND(), the implication is both VLOOKUPs will work which makes the "false" redundant. It will never appear, what will appear is an error on one or more of the VLOOKUPs or the value "true".

    #N/A means the value cant be found

    #VALUE can mean the lookup exceeds 255 chars
    or Full path to the lookup workbook is not supplied

    Can you post the data for a thorough check?
    Last edited by Special-K; 01-17-2019 at 12:18 PM.

  11. #11
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Formula to return as true or false

    I broke up the formula

    =IF(VLOOKUP(A6,Table1[ID],1,0),"A","B") returns #VALUE! error

    =VLOOKUP(A6,Table1[ID],1,0) returns value from cell A6
    so definately something to do with IF formula
    Last edited by mikehk; 01-17-2019 at 12:29 PM.

  12. #12
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Formula to return as true or false

    I tried ....

    =IF(VLOOKUP(A6,Table1[ID],1,0)=FALSE,"a","b") returns b

    =IF(VLOOKUP(A6,Table1[ID],1,0)=TRUE,"a","b") returns b

  13. #13
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: Formula to return as true or false

    Quote Originally Posted by mikehk View Post
    I tried ....

    =IF(VLOOKUP(A6,Table1[ID],1,0)=FALSE,"a","b") returns b

    =IF(VLOOKUP(A6,Table1[ID],1,0)=TRUE,"a","b") returns b
    So the data in your Table1[ID] comprises of a list of TRUE or FALSE, though the results from above suggest it's something other than TRUE or FALSE?
    Last edited by Special-K; 01-17-2019 at 12:24 PM.

  14. #14
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Formula to return as true or false

    it doesn't

  15. #15
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: Formula to return as true or false

    Looks like you're only interested in the values being present, not actually what the values are.
    Can't you just do a

    =IF(AND(NOT(ISNA(VLOOKUP(Calendar!$A21,Table1[Ref]:Table1[Email],14,0))),NOT(ISNA(VLOOKUP(Calendar!$B$15,Table1[Ref]:Table1[Email],8,0)))),TRUE,FALSE)

  16. #16
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: Formula to return as true or false

    Thanks a lot but sorry this formula returns FALSE for everything.

    That's true I am only interested in values being present and not actually what they are,
    all I need is if cell A21 and B15 match, return true or yes or "abc" and if they are not return
    false or no...or "xyz" !

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,924

    Re: Formula to return as true or false

    Attach the workbook, please.

  18. #18
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2507
    Posts
    13,809

    Re: Formula to return as true or false

    Workbook attached is a good idea.

    In the meantime, drawing from the formula from Post#1, try
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    A
    B
    C
    D
    E
    F
    G
    H
    1
    Source
    ID
    StartDate
    EndDate
    173
    1/21/2019
    TRUE
    2
    Bob
    110
    1/19/2019
    1/22/2019
    170
    1/26/2019
    FALSE
    3
    John
    194
    1/24/2019
    1/29/2019
    159
    1/26/2019
    FALSE
    4
    Mike
    159
    1/18/2019
    1/23/2019
    106
    1/23/2019
    TRUE
    5
    Jacob
    173
    1/21/2019
    1/26/2019
    6
    Kelly
    170
    1/22/2019
    1/26/2019
    7
    Martha
    159
    1/21/2019
    1/26/2019
    8
    Joe
    106
    1/23/2019
    1/28/2019
    9
    Rachel
    135
    1/19/2019
    1/24/2019
    10
    Liz
    154
    1/18/2019
    1/22/2019
    11
    Dave

+ 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. Replies: 3
    Last Post: 08-16-2018, 06:07 AM
  2. [SOLVED] Match formula to search range of columns to return True or False result
    By Twaddy006 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-09-2015, 05:42 PM
  3. [SOLVED] formula to lookup formatting and return true false
    By paintballlovr in forum Excel General
    Replies: 2
    Last Post: 05-17-2012, 09:32 AM
  4. Return True/False if cell contains formula
    By rziegler in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-09-2009, 03:03 PM
  5. [SOLVED] Search for 2 true arguments and return true or false
    By David in forum Excel General
    Replies: 3
    Last Post: 07-15-2006, 05:20 AM
  6. Easy formula to return a true or false
    By motol in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-03-2006, 10:50 PM
  7. Function to return True/False if all are validated as True by ISNU
    By Tetsuya Oguma in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-15-2006, 06:30 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