+ Reply to Thread
Results 1 to 10 of 10

VLOOKUP and IF Function

  1. #1
    Registered User
    Join Date
    05-26-2015
    Location
    Madrid, Spain - Hamburg, Germany
    MS-Off Ver
    2013
    Posts
    29

    VLOOKUP and IF Function

    Hey guys,

    I hope you can help me with this problem:

    I have created three different VLOOKUP functions that calculate the Co2-Tax Fee on our Cars for different type of tires.
    I now want to do an IF Function that checks those 3 values. If they are all the same, it doesn't need to do anything. If they differ though I need any form of Alert.

    Here is what I created:

    =IF(VLOOKUP(TRIM("Co2-Tax Tire 1");1:1048576;COLUMNS(C:C);)=VLOOKUP(TRIM("Co2-Tax Tire 2");1:1048576;COLUMNS(C:C);)=VLOOKUP(TRIM("Co2-Tax Tire 3");1:1048576;COLUMNS(C:C););"";"! ! !")

    As a result I always get ! ! !. Even when the function should be true.

    Can anybody see the mistake I've done with the given information.

    I don't want to post the file if avoidable, because I don't know how confidential the data is.

    Thank you very much for any help!
    Greetings from Madrid, Spain :))

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: VLOOKUP and IF Function

    The Syntax of the formula does not make sense to me..

    I guess, its better if you can attach a sample workbook, if your data is confidential..
    Cheers!
    Deep Dave

  3. #3
    Registered User
    Join Date
    05-26-2015
    Location
    Madrid, Spain - Hamburg, Germany
    MS-Off Ver
    2013
    Posts
    29

    Re: VLOOKUP and IF Function

    Ok,

    Here you have the file with numbers in the relevant field.

    The questioned formula is in field C4.

    Thank you!
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,290

    Re: VLOOKUP and IF Function

    =if(SUM(C151:C153)/3=C151;"";"alert")
    does this work?
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  5. #5
    Registered User
    Join Date
    05-26-2015
    Location
    Madrid, Spain - Hamburg, Germany
    MS-Off Ver
    2013
    Posts
    29

    Re: VLOOKUP and IF Function

    No it has to be done through VLOOKUP because this formula is supposed to work on many worksheets, in which the Rows and colums differ...
    I can try if the sum thing works though

  6. #6
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,290

    Re: VLOOKUP and IF Function

    =if(SUM(vlookup1+vlookup2+vlookup3)/3=vlookup1;"";"alert")
    Then do it this way

  7. #7
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,578

    Re: VLOOKUP and IF Function

    Try this,
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-26-2015
    Location
    Madrid, Spain - Hamburg, Germany
    MS-Off Ver
    2013
    Posts
    29

    Re: VLOOKUP and IF Function

    popipipo & kvsrinivasamurthy Thank you both for your Input. The Sum formula doesn't work if I have no value in one cell. I tried average=one of the cellls, but it doesn't work neither.
    The And( doesn't work as well

  9. #9
    Registered User
    Join Date
    05-26-2015
    Location
    Madrid, Spain - Hamburg, Germany
    MS-Off Ver
    2013
    Posts
    29

    Re: VLOOKUP and IF Function

    The mistake seems to be in the Column part of the vlookups..
    if i just put in =VLOOKUP(TRIM("Co2-Tax Tire 1");1:1048576;COLUMNS(C:C);)
    it gives me: 'Co2-Tax Tire 1' instead of the value in Column C

  10. #10
    Registered User
    Join Date
    05-26-2015
    Location
    Madrid, Spain - Hamburg, Germany
    MS-Off Ver
    2013
    Posts
    29

    Re: VLOOKUP and IF Function

    Guys it works!
    The one mistake that was left was that I used columns(C:C) instead of Column(C:C).
    With the formula of kvsrinivasamurthy it now works.

    Thank you all!

+ 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. [SOLVED] Trying to Multiply the result of an IF function combined with a VLOOKUP function
    By ucca in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-28-2018, 02:32 AM
  2. Replies: 2
    Last Post: 01-15-2014, 11:40 PM
  3. Worksheet function Vlookup and VLOOKUP return different results
    By zandero in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-08-2010, 08:24 AM
  4. Replies: 1
    Last Post: 12-02-2005, 09:35 AM
  5. [SOLVED] vlookup function-Can vlookup command find the data from the 5 sheets.
    By Rishab shah in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM

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