+ Reply to Thread
Results 1 to 7 of 7

workaround for exceeding 7 nested functions in Excel?

  1. #1
    Registered User
    Join Date
    02-21-2008
    Posts
    5

    Question workaround for exceeding 7 nested functions in Excel?

    I'm new to excel but reckon it can help me do a lot of the mundane tasks i've been landed with so - I'm attempting to work out overdue invoices using IF AND function in Excel. The worksheet is one I use for work so cannot be changed - I have to work with what's there. Attached - it's quite big so I've deleeted some of it ...

    In column AA I've created a formula that looks at the current month entered in month in AA2 and then checks to see if invoices are overdue for the preceding months - trouble is there are 12 months that I need to check and the function only allows me to check 7.

    Formula:

    =(IF((AND(AO3>0,current_month="April")),"Due",IF((AND(AO3>0,current_month="May")),"overdue",IF((AND(AQ3+AO3>0,current_month="June")),"overdue",IF((AND(AS3+AQ3+AO3>0,current_month="July")),"overdue",IF((AND(AU3+AS3+AQ3+AO3>0,current_month="August")),"overdue",IF((AND(AW3+AU3+AS3+AQ3+AO3>0,current_month="September")),"overdue",IF((AND(AY3+AW3+AU3+AS3+AQ3+AO3>0,current_month="October")),"overdue","OK"))))))))

    anyone got any work around or can suggest how I can do this more easily using another function? - bear in mind I have no power to change how the file is laid out!!
    Attached Files Attached Files

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You can try eliminating nested IF's by enclosing the "overdue" conditions within an OR() function....

    e.g. In AA3 of your sample sheet enter formula:

    Please Login or Register  to view this content.
    add extra conditions after October's condition...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    02-28-2006
    Posts
    690
    another approach is to calculate the total days overdue and use a look up table to give you months, then make a summary table from your data using either a pivot table or the sumproduct function.....

  4. #4
    Registered User
    Join Date
    02-21-2008
    Posts
    5

    Thanks - that first one from the moderator works brilliantly.

    please delete this if it is a frivoulous use of the forum - but really wanted to thank you...

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by marcia21
    please delete this if it is a frivoulous use of the forum - but really wanted to thank you...
    No need to delete...not wasted use of the forum.

    We appreciate the feedback and your positive reply will make other users confident that the formula works so that if they have a similar problem they can apply this solution.

  6. #6
    Registered User
    Join Date
    02-08-2008
    Location
    Co. Down, Ireland.
    Posts
    53
    Quote Originally Posted by marcia21
    I'm new to excel but reckon it can help me do a lot of the mundane tasks i've been landed with so - I'm attempting to work out overdue invoices using IF AND function in Excel. The worksheet is one I use for work so cannot be changed - I have to work with what's there. Attached - it's quite big so I've deleeted some of it ...

    In column AA I've created a formula that looks at the current month entered in month in AA2 and then checks to see if invoices are overdue for the preceding months - trouble is there are 12 months that I need to check and the function only allows me to check 7.

    Formula:

    =(IF((AND(AO3>0,current_month="April")),"Due",IF((AND(AO3>0,current_month="May")),"overdue",IF((AND(AQ3+AO3>0,current_month="June")),"overdue",IF((AND(AS3+AQ3+AO3>0,current_month="July")),"overdue",IF((AND(AU3+AS3+AQ3+AO3>0,current_month="August")),"overdue",IF((AND(AW3+AU3+AS3+AQ3+AO3>0,current_month="September")),"overdue",IF((AND(AY3+AW3+AU3+AS3+AQ3+AO3>0,current_month="October")),"overdue","OK"))))))))

    anyone got any work around or can suggest how I can do this more easily using another function? - bear in mind I have no power to change how the file is laid out!!
    Use defined names.

    Try this link Nested Cells

    I know this is answered yet wanted to add another suggestion.

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,677
    My view, in general, is that if you need more than 7 IFs you're using the wrong function. Try this formula in AA3

    =IF((AND(B3>0,current_month="April")),"Due",IF( SUMPRODUCT(--(COLUMN(B3:X3)<MATCH(LEFT(current_month,3),{"Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","Jan","Feb","Mar"},0)*2),--(MOD(COLUMN(B3:X3),2)=0),B3:X3),"Overdue","OK"))

+ 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