+ Reply to Thread
Results 1 to 6 of 6

Combine IF with Vlookup

  1. #1
    Registered User
    Join Date
    06-14-2022
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    16

    Combine IF with Vlookup

    Good day,

    I am using the below formula to return a value, however need to add an IF statement to say if the number is greater than or equal to "5", it should return "5" if not greater or equal to then provide the number from the vlookup that is below "5"

    =IF(ISERROR(VLOOKUP($B$4;'Combined AM2'!$B$427:$P$463;3;FALSE));"0";VLOOKUP($B$4;'Combined AM2'!$B$427:$P$463;3;FALSE))

    Thanks.

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

    Re: Combine IF with Vlookup

    Try this:

    =IF($B$4>=5;5;IF(ISERROR(VLOOKUP($B$4;'Combined AM2'!$B$427:$P$463;3;FALSE));0;VLOOKUP($B$4;'Combined AM2'!$B$427:$P$463;3;FALSE)))

    or this:

    =IF($B$4>=5;5;IFERROR(VLOOKUP($B$4;'Combined AM2'!$B$427:$P$463;3;FALSE));0))

    Maybe this is what you want:

    =MAX(5;IFERROR(VLOOKUP($B$4;'Combined AM2'!$B$427:$P$463;3;FALSE));0))

    Why are you using the semi-colon as a delimiter in SA? I thought SA used the comma - are you using a European locale on your machine?
    Last edited by AliGW; 01-25-2024 at 05:13 AM.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    06-14-2022
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    16

    Re: Combine IF with Vlookup

    Good day Ali,

    Thank You for the help, however they are not working. I need the vlookup to be done first before the IF statement.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,448

    Re: Combine IF with Vlookup

    This?

    =IF(IFERROR(VLOOKUP($B$4;'Combined AM2'!$B$427:$P$463;3;FALSE);0)>=5;5;IFERROR(VLOOKUP($B$4;'Combined AM2'!$B$427:$P$463;3;FALSE);0)

    ???

    Would be the same as:

    =MIN(5;IFERROR(VLOOKUP($B$4;'Combined AM2'!$B$427:$P$463;3;FALSE));0))

  5. #5
    Registered User
    Join Date
    06-14-2022
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    16

    Re: Combine IF with Vlookup

    Thank You so Much Ali. Working perfectly. Much Appreciated!

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,448

    Re: Combine IF with Vlookup

    You're welcome, but why are you using semi-colons in South Africa??? What is your locale?

+ 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] combine an if and a Vlookup
    By shaz0503 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-05-2014, 01:50 AM
  2. [SOLVED] Not sure if I need to combine IF and VLOOKUP??
    By katro in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-30-2013, 09:28 AM
  3. Can 'IF' and 'VLOOKUP' combine?
    By hpackwood in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-20-2013, 12:27 PM
  4. [SOLVED] combine IF and VLOOKUP and sum it
    By l1N6 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-14-2013, 06:18 AM
  5. combine if & vlookup
    By zaenibop in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-11-2012, 02:43 PM
  6. Combine vlookup with between...
    By Philistine in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-18-2011, 11:23 AM
  7. Combine vlookup and if
    By sevago00 in forum Excel General
    Replies: 3
    Last Post: 11-20-2009, 11:54 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