+ Reply to Thread
Results 1 to 6 of 6

IF formula nested not working

  1. #1
    Registered User
    Join Date
    06-23-2005
    Posts
    86

    IF formula nested not working

    Hi Guys
    Can anyone help please

    I have this formula:

    =IF(AND(EOMONTH($S23,0)=(EOMONTH(AW$2,0)),$O23="One-Off"),$AB23,IF(AND(EOMONTH(AW$2,0)>=(EOMONTH($S23,0)),EOMONTH(AW$2,0)<=(EOMONTH($T23,0)),($S23=DATE(YEAR(AW$2),MONTH(AW$2),1))),$AC23,IF(EOMONTH($S23,0)=EOMONTH(AW$2,0),$AB23/$U23*(EOMONTH(AW$2,0)-$S23),IF(EOMONTH($T23,0)=EOMONTH(AW$2,0),$AB23-SUM($AJ23:AV23),IF(AND(EOMONTH(AW$2,0)>=(EOMONTH($S23,0)),EOMONTH(AW$2,0)<=(EOMONTH($T23,0))),IF(EOMONTH($S23,0)=EOMONTH(AW$2,0),$AB23/$U23*(EOMONTH(AW$2,0)-$S23),IF(EOMONTH($T23,0)=EOMONTH(AW$2,0),$AB23-SUM($AJ23:AV23),$AC23)),0)))))

    Basically I want to say this:

    Where month column and cell text is "One-Off", pick up AB23,

    =IF(AND(EOMONTH($S23,0)=(EOMONTH(AW$2,0)),$O23="One-Off"),$AB23,

    But then I want it to say zero if false.

    But then if it is not "One-Off" do this:

    IF(AND(EOMONTH(AW$2,0)>=(EOMONTH($S23,0)),EOMONTH(AW$2,0)<=(EOMONTH($T23,0)),($S23=DATE(YEAR(AW$2),MONTH(AW$2),1))),$AC23,IF(EOMONTH($S23,0)=EOMONTH(AW$2,0),$AB23/$U23*(EOMONTH(AW$2,0)-$S23),IF(EOMONTH($T23,0)=EOMONTH(AW$2,0),$AB23-SUM($AJ23:AV23),IF(AND(EOMONTH(AW$2,0)>=(EOMONTH($S23,0)),EOMONTH(AW$2,0)<=(EOMONTH($T23,0))),IF(EOMONTH($S23,0)=EOMONTH(AW$2,0),$AB23/$U23*(EOMONTH(AW$2,0)-$S23),IF(EOMONTH($T23,0)=EOMONTH(AW$2,0),$AB23-SUM($AJ23:AV23),$AC23)),0)))))

    I realise I have two false criterias and its probably my nested logic, but I would really appreciate some help from the experts on here.

    Thanks
    CD

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: IF formula nested not working

    There appears to be quite a bit of repeated logic in your formula, perhaps something better referenced via a table lookup with comparisons.

    Can you attach an example of how you're applying the formula?
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    06-23-2005
    Posts
    86

    Re: IF formula nested not working

    Hi Daffodil

    Thanks for replying

    I just need to spread across dates in Cols AJ:BI (unless it is "One Off" in Col O where I want it posted in the matching month header coloumn from Col S only)

    If not "One Off" spread across matching month header columns from Col S and Col T.

    thanks for looking
    CD
    Attached Files Attached Files

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: IF formula nested not working

    I'm not sure I quite understand what your formula isn't doing that you want it to.

    I rewrote the formula inserting manual line breaks with Alt+Enter, and spaces to line up the expressions.
    I also removed a number of superfluous parens. Functionally, this formula operates no different but it's considerably easier to troubleshoot and understand.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-08-2010
    Location
    Qatar
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: IF formula nested not working

    Try countif formula!!!

  6. #6
    Registered User
    Join Date
    06-23-2005
    Posts
    86

    Re: IF formula nested not working

    Hi both

    Thanks for your help

    I will try and work my way through it.

    Anyone else who can help it is appreciated

    Thanks
    Mark

+ 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. IF( AND( NESTED formula is not working
    By genetist in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-01-2014, 01:54 AM
  2. [SOLVED] Nested IF AND SEARCH formula not working
    By dcdeez in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-11-2013, 06:40 AM
  3. [SOLVED] Nested if formula not working as intended
    By Reibie in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-11-2013, 05:59 AM
  4. Nested IF formula partially not working
    By Mattacola in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-14-2012, 03:21 PM
  5. [SOLVED] If-Then nested formula not working...must be a syntax error
    By sunny_island2002 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-16-2012, 02:37 PM

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