+ Reply to Thread
Results 1 to 9 of 9

Adding condition to existing formula

  1. #1
    Registered User
    Join Date
    10-05-2009
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    76

    Adding condition to existing formula

    I have an existing formula that I am using, however, I need to add another condition to it but am unsure on where to add into the formula to make it work correctly. Any help would be greatly appreciated.

    I need to add (NEW!$H2:$H65000="MBA.ACC")

    to

    =SUM(IF(FREQUENCY(IF(LEN(NEW!$C$2:$C$65000)>0,MATCH(NEW!$C$2:$C$65000,NEW!$C$2:$C$65000,0),""), IF(LEN(NEW!$C$2:$C$65000)>0,MATCH(NEW!$C$2:$C$65000,NEW!$C$2:$C$65000,0),""))>0,1))

    Thanks in advance.
    Last edited by KINNEY0201; 09-16-2010 at 02:01 PM.

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

    Re: Adding condition to existing formula

    So, it seems you're trying to count unique items in C (non blank/null) where H is "MBA ACC", correct ?

    Please Login or Register  to view this content.
    or, with SUMPRODUCT

    Please Login or Register  to view this content.
    Both are as inefficient as each other... irrespective of which you use you should look to limit the range you're referencing - as is the above are processing hundreds of thousands of cells in an iterative manner.

  3. #3
    Registered User
    Join Date
    10-05-2009
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: Adding condition to existing formula

    Neither of these formulas are working.

    They both produce a result of 0, which is incorrect.

    Any assistance would be greatly appreciated.

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

    Re: Adding condition to existing formula

    Both work when tested so the implication is source data to which we have no access.

    In an attempt to identify the problem - what does the below return ?

    =COUNTIFS(NEW!$C$2:$C$65000,"?*",NEW!$C$H$2:$H$65000,"MBA ACC")

  5. #5
    Registered User
    Join Date
    10-05-2009
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: Adding condition to existing formula

    Well, at first, it return an invalid formula message due to the extra "C" in the formula. After removing that, it again returns 0.

    Anyone else?

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

    Re: Adding condition to existing formula

    The fact it returns 0 tells you have zero rows in your dataset that meet the criteria -- I'm assuming NEW Column C contains text ?
    [the countifs was not a solution - merely a means of identifying the problem - ie you have no data that satisfies your requirements]

    What does the below return ?

    =COUNTIF(New!H$2:$H$65000,"MBA ACC")

    If you would prefer I leave this for someone else I am happy to do so - just say.

  7. #7
    Registered User
    Join Date
    10-05-2009
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: Adding condition to existing formula

    I removed names and attached the spreadsheet I am currently building.

    Attaching formula to sheet 2.
    Attached Files Attached Files

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

    Re: Adding condition to existing formula

    OK error on my part - I misread the MBA.ACC - ie used space rather than period between the strings - modify the earlier suggestions accordingly.

  9. #9
    Registered User
    Join Date
    10-05-2009
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: Adding condition to existing formula

    Quote Originally Posted by DonkeyOte View Post
    OK error on my part - I misread the MBA.ACC - ie used space rather than period between the strings - modify the earlier suggestions accordingly.
    That did the trick. It was the space. Thanks for your help. I will mark as solved.

    Thanks again for your help,

+ 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