+ Reply to Thread
Results 1 to 5 of 5

Too many IFs-when trying to apply my IF function ?

  1. #1
    Registered User
    Join Date
    11-20-2009
    Location
    south wales
    MS-Off Ver
    Excel 2007
    Posts
    14

    Too many IFs-when trying to apply my IF function ?

    when trying to apply my IF function to excel i keep getting the following error:

    "the specified formula cannot be entered because it uses more levels of nesting than are allowed in the current file format."

    here is the formula im trying to enter:

    =IF(AND(O174>=2000,O174<2050),VLOOKUP(TRUE,Sheet6!O73:AA783,10,FALSE),IF(AND(O174>=2050,O174<2100),VLOOKUP(TRUE,Sheet6!AC74:AO784,10,FALSE),IF(AND(O174>=2100,O174<2150),VLOOKUP(TRUE,Sheet6!AQ56:BC766,10,FALSE),IF(AND(O174>=2150,O174<2200),VLOOKUP(TRUE,Sheet6!BE74:BQ784,10,FALSE),IF(AND(O174>=2200,O174<2250),VLOOKUP(TRUE,Sheet6!BS74:CE784,10,FALSE),IF(AND(O174>=2250,O174<2300),VLOOKUP(TRUE,Sheet6!CG74:CS784,10,FALSE),IF(AND(O174>=2350,O174<2400),VLOOKUP(TRUE,Sheet6!DI74:DU784,10,FALSE),IF(AND(O174>=2400,O174<2450),VLOOKUP(TRUE,Sheet6!DW74:EI784,10,FALSE),IF(AND(O174>=2450,O174<2500),VLOOKUP(TRUE,Sheet6!EK74:EW784,10,FALSE),IF(AND(O174>=2500,O174<4000),VLOOKUP(TRUE,Sheet6!EY74:FK784,10,FALSE),0))))))))))

    i followed a help file from a website for IF and and functions to do 2 variables, why does it not work with the 9 variables i have above?

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    re: Too many IFs-when trying to apply my IF function ?

    7 nested ifs is your limit pre excel 2007
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,602

    re: Too many IFs-when trying to apply my IF function ?

    Please describe the layout and data on sheet6 and why the lookup value is always TRUE.
    Ben Van Johnson

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    re: Too many IFs-when trying to apply my IF function ?

    You could probably use CHOOSE function to give you more options. The only thing that differs for each VLOOKUP appears to be the lookup range so you can use a CHOOSE(MATCH construction to supply the right lookup range based on the value in O174.

    It looks like you have a VLOOKUP missing, though, as you haven't covered the range from 2300 to 2350. I put an "x" in the formula where the missing range should be....

    =IF(AND(O174>=2000,O174<4000),VLOOKUP(TRUE,CHOOSE(MATCH(O174-2000,{0,50,100,150,200,250,300,350,400,450,500}),Sheet6!O73:AA783,Sheet6!AC74:AO784, Sheet6!AQ56:BC766,Sheet6!BE74:BQ784,Sheet6!BS74:CE784,Sheet6!CG74:CS784,"X",Sheet6!DI74:DU784,Sheet6!DW74:EI784,Sheet6!EK74:EW784,Sheet6!EY74:FK784),10,FALSE),0)
    Last edited by daddylonglegs; 11-22-2009 at 03:43 PM.

  5. #5
    Registered User
    Join Date
    11-20-2009
    Location
    south wales
    MS-Off Ver
    Excel 2007
    Posts
    14

    re: Too many IFs-when trying to apply my IF function ?

    ahh thanks thats brilliant!
    Last edited by shg; 11-22-2009 at 07:27 PM. Reason: deleted spurious quote

+ 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