+ Reply to Thread
Results 1 to 8 of 8

Can you nest Lookup fucntions in an IF function?

  1. #1
    Registered User
    Join Date
    01-12-2021
    Location
    La Nucia, Spain
    MS-Off Ver
    ffice 365
    Posts
    3

    Can you nest Lookup fucntions in an IF function?

    Hi, total newbie here and thus I apologies if there are other threads addressing this (I did look through the first 3 pages and couldn't find one).

    I was wondering if you can nest Lookup functions in an IF function?

    I'm trying to create a marksheet for the school where I work, whereby the spreadsheet will check which test a student has done (3 options), then look up what mark they have got from 3 different lookup tables.

    I tried writing:

    =IF(G3=3, "LOOKUP(F3,'Look Up Tables'!A$2:B$102)", IF(G3=2, "LOOKUP(F3,'Look Up Tables'!C$2:D$102)", IF(G3=1, "LOOKUP(F3,'Look Up Tables'!E$2:F$102)", "Absent")))

    Can anyone give me some guidance as to whether what I'm attempting is possible and, if so, where I might be going wrong?

    Many thanks in advance

    TB

  2. #2
    Registered User
    Join Date
    01-12-2021
    Location
    La Nucia, Spain
    MS-Off Ver
    ffice 365
    Posts
    3

    Re: Can you nest Lookup fucntions in an IF function?

    To clarify G3 says which test they did; F3 says what percentage they got.

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,069

    Re: Can you nest Lookup fucntions in an IF function?

    Try it like
    =IF(G3=3, LOOKUP(F3,'Look Up Tables'!A$2:B$102), IF(G3=2, LOOKUP(F3,'Look Up Tables'!C$2:D$102), IF(G3=1, LOOKUP(F3,'Look Up Tables'!E$2:F$102), "Absent")))

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Can you nest Lookup fucntions in an IF function?

    =IF(G3=3, vLOOKUP(F3,'Look Up Tables'!A$2:B$102,2,0), IF(G3=2, vLOOKUP(F3,'Look Up Tables'!C$2:D$102,2,0), IF(G3=1, vLOOKUP(F3,'Look Up Tables'!E$2:F$102,2,0), "Absent")))


    although an attachment as per the banner would make life easier and give you a better answer


    you can use ifs in 365 which makes it a bit shorter as well as you do not need to nest them
    =IFs(G3=3, vLOOKUP(F3,'Look Up Tables'!A$2:B$102,2,0),G3=2, vLOOKUP(F3,'Look Up Tables'!C$2:D$102,2,0), G3=1, vLOOKUP(F3,'Look Up Tables'!E$2:F$102,2,0), "Absent")


    we are assuming, works for you and not ; as your separation character
    Last edited by davsth; 01-12-2021 at 10:59 AM.

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,069

    Re: Can you nest Lookup fucntions in an IF function?

    you can use ifs in 365 which makes it a bit shorter as well as you do not need to nest them
    But could easily slow things down.
    The IFS function will calculate every lookup/vlookup, whereas the nested if will only calculate one of them.

  6. #6
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Can you nest Lookup fucntions in an IF function?

    Interesting to know Fluff, every day is a schoolday!

  7. #7
    Registered User
    Join Date
    01-12-2021
    Location
    La Nucia, Spain
    MS-Off Ver
    ffice 365
    Posts
    3

    Re: Can you nest Lookup fucntions in an IF function?

    Quote Originally Posted by Fluff13 View Post
    Try it like
    =IF(G3=3, LOOKUP(F3,'Look Up Tables'!A$2:B$102), IF(G3=2, LOOKUP(F3,'Look Up Tables'!C$2:D$102), IF(G3=1, LOOKUP(F3,'Look Up Tables'!E$2:F$102), "Absent")))
    Thank you! That worked perfectly (and, most importantly, didn't screw up when I uploaded to Google Drive and thus turned it into a Google Sheet).

    Many thanks to you and the other contributors to this thread.

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,069

    Re: Can you nest Lookup fucntions in an IF function?

    Glad to help & thanks for the feedback.

+ 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 Nest Formulas LOOKUP and IF
    By JSelmstar in forum Excel General
    Replies: 5
    Last Post: 04-10-2018, 06:56 PM
  2. [SOLVED] Nest lookup Function to lookup name between date range and return value
    By bbeards in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2018, 01:37 PM
  3. [SOLVED] V Look & CounIF Fucntions
    By akbar in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 04-17-2013, 06:26 AM
  4. Nest Lookup With If And Statements
    By opeyemi1 in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 02-19-2008, 11:57 AM
  5. Advanced Lookup and Average Nest Function
    By ucdivingcu in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-26-2007, 11:10 AM
  6. HOW DO I NEST MORE THAN 1 IF FUNCTION?
    By Rochelle B in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-27-2005, 10:06 AM

Tags for this Thread

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