+ Reply to Thread
Results 1 to 8 of 8

Nesting If statements w/ Vlookups

Hybrid View

  1. #1
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Nesting If statements w/ Vlookups

    I would add ...

    what data type resides in H (number, text) ...
    what do you want to return if it's an error...
    what version of Excel are you running...

    Assuming for ex. you're pre 2007... H contains numbers... for error return 0...

    =IF(ISNUMBER(MATCH(C73,{6,12,24},0)),LOOKUP(9.99999999999999E+307,CHOOSE({1,2},0,VLOOKUP(D73,IF(C73=6,'Package Mix'!$G$39:$H$45,IF(C73=12,'Package Mix'!$G$6:$H$36,'Package Mix'!$G$48:$H$56)),2,0))),"")
    (if you wanted blank rather than 0 you could use a Custom Format to set 0 to null)

    Ditto other comments re: INT

  2. #2
    Registered User
    Join Date
    09-06-2008
    Location
    Philly
    Posts
    40

    Re: Nesting If statements w/ Vlookups

    Oh, this works too. Is this a more efficient way to do it than the other way?

    G is the product name, H is the inventory id #. 12/6/24 are the different package configurations.




    Quote Originally Posted by DonkeyOte View Post
    I would add ...

    what data type resides in H (number, text) ...
    what do you want to return if it's an error...
    what version of Excel are you running...

    Assuming for ex. you're pre 2007... H contains numbers... for error return 0...

    =IF(ISNUMBER(MATCH(C73,{6,12,24},0)),LOOKUP(9.99999999999999E+307,CHOOSE({1,2},0,VLOOKUP(D73,IF(C73=6,'Package Mix'!$G$39:$H$45,IF(C73=12,'Package Mix'!$G$6:$H$36,'Package Mix'!$G$48:$H$56)),2,0))),"")
    (if you wanted blank rather than 0 you could use a Custom Format to set 0 to null)

    Ditto other comments re: INT

+ 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