+ Reply to Thread
Results 1 to 4 of 4

IF() statements not working out right

  1. #1
    Registered User
    Join Date
    10-26-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    7

    IF() statements not working out right

    Hi Guys
    Long time reader, 1st time posting

    I've been having a issue with a if() statement on my workbook, KSCYC tab, Column E. For some reason cells E5 and E11 IF() wants to work correctly, but cells E7,9, 13,15 and 17 cannot find the #value or return a false in the Vlookup logical test. Not to sure if i'm missing something or getting the code back to front.
    Any help would be appreciated.

    Cell E5 IF() statement
    =IF(VLOOKUP(B5,Members, 2, FALSE),VLOOKUP(B5,Members, 2,FALSE),"Member not in Database")
    is returning a True logical test but
    cell E7 IF() statement
    =IF(VLOOKUP(B5,Members,3,FALSE),VLOOKUP(B5,Members,3,FALSE),"Add User Details")
    is returning a #value error on the logical yet the data is correct on the same row.
    I figure maybe a ISNA at the start may fix the issue but it returns a as 'value as false'

    Thankyou


    KSCYC Test1.xlsm
    Last edited by sumitos; 05-21-2013 at 09:59 PM. Reason: Added more detail to problem

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: IF() statements not working out right

    try the isblank

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    -> note the message first "member...." before the other vlookup
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: IF() statements not working out right

    an IF() statement consists of 3 parts

    a test
    what to do is the test is valid/TRUE
    what to do is the test is invalid/FALSE

    Both of your if() statements start with a function, not a test...=IF(VLOOKUP(B5,Members, 2, FALSE)..is what???....= to something?...not = to something?....returns a value?....returns an error?
    See what I mean? you start with the 1st part of the test, but you dont complete it. Vlad's suggestion is turning your vlookup() function into a test...=if(isblank(vlookup(). In other words if the vlookup returns a blank

    although it should probably be shortened to...
    =IFerror(VLOOKUP(B5,Members, 2, FALSE),"Member not in Database")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    10-26-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: IF() statements not working out right

    Thank you Vlady for the quick reply on correcting my issue. All the codes worked nicely except for Type and Fee, not to sure why, but changing the 1st vlookups column index number from a 6 and 7 both to a 2 fixed it..go figure. all members when clicked show their detail.

    To FDibbins
    yeh i know i'm positive i'm if() dylexic somtimes.
    Thankyou for the help and input but your shortened =iferror just leaves a blank cell return. i need something to return a text telling the person to add the user detail to the database as a reminder regardless of how much info that added at the start.
    And the code Vlady provided worked as intended.

+ 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