+ Reply to Thread
Results 1 to 9 of 9

Simplify a sum.if - and divide formula

  1. #1
    Registered User
    Join Date
    08-19-2015
    Location
    London, England
    MS-Off Ver
    365
    Posts
    67

    Simplify a sum.if - and divide formula

    Hi,

    Is there a way to simplify my formula..?

    Formula used (please see attachment):

    =IF(TODAY()>A22,SUM.IF(Table4[Date],"<="&A22,Table4[Value2])/(SUM.IF(Table4[Date],"<="&A22,Table4[Value1])-SUM.IF(Table4[Date],"<="&A22,Table4[Value3])),"")

    Right now my formula uses 3 times the 'SUM.IF(Table4[Date];"<="&A22' part and it gets the job done but I'd like to clean it up, but can't figure out how, if at all possible.

    Many thanks in advance....

    Mike
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,668

    Re: Simplify a sum.if - and divide formula

    What's the calculation for? What is it meant to be doing? What are values 1, 2 and 3 in reality?

    You say you are in London, but your PC's locale is not UK - why the anomaly?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-19-2015
    Location
    London, England
    MS-Off Ver
    365
    Posts
    67

    Re: Simplify a sum.if - and divide formula

    I would like to calculate a cumulative percentage based on a service level agreement, where value2 is answered calls within servicelevel, divided by value 1 (offered) minus value3 (abandoned within servicelevel).

    For your second question: I don't know, I do however work in London on a regular base, but now I'm not...

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Simplify a sum.if - and divide formula

    Quote Originally Posted by blak9 View Post
    Is there a way to simplify my formula..?
    it gets the job done
    If it ain't broke, don't try to fix it!
    To try and simplify it (if at all possible), you would need to replace the repeated part that you want to remove with a series of less efficient arrays capable of performing the same task.

  5. #5
    Registered User
    Join Date
    08-19-2015
    Location
    London, England
    MS-Off Ver
    365
    Posts
    67

    Re: Simplify a sum.if - and divide formula

    Thanks, I was hoping some kind of sumproduct formula could do the trick, maybe something like:

    =SUMPRODUCT(--(Table4[Date]<=A22);Table4[Value2]/(Table4[Value1]-Table4[Value3]))

  6. #6
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Simplify a sum.if - and divide formula

    It will work with the correct syntax, but the results will not be the same.

    With your sumif formula, for date 02/04/19, the result is (58+52)/((65+68)-(2+10))

    With sumproduct for the same date, it would be (58/(65-2))+(52/(68-10))

    To achieve the same result as your formula with sumproduct would require a formula far less simple than your existing one.

    Additionally, sumproduct will take longer to calculate than sumif with large volumes of data.

    With experience, you will discover that the simplest formula is not always the shortest one, or the most pracrical.

  7. #7
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Simplify a sum.if - and divide formula

    Hi

    if the two calendars don't skip any date

    =sumproduct(C$3:C3/sum(B$3:B3-D$3:D3))
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  8. #8
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Simplify a sum.if - and divide formula

    Quote Originally Posted by canapone View Post
    if the two calendars don't skip any date
    The first one does.

    I think that this is the shortest formula that will return the same results as the original, whether or not it is cleaner / simplified is a matter of opinion.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Noting the comments in the sample file,
    SHEET 1: Table can contain several years of data (so I'd rather not use any formulas in this table)
    SHEET 2, always limited to 1 month
    personally, I would stick with the original sumif formula for efficiency.

  9. #9
    Registered User
    Join Date
    08-19-2015
    Location
    London, England
    MS-Off Ver
    365
    Posts
    67

    Re: Simplify a sum.if - and divide formula

    Thanks a lot, I'll stick with my original formula, but I still learned something in the process of studying your answers...

+ 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. [SOLVED] Simplify IF formula
    By bibu in forum Excel General
    Replies: 2
    Last Post: 03-28-2014, 08:43 AM
  2. Simplify this formula?
    By kregd in forum Excel General
    Replies: 4
    Last Post: 06-12-2010, 03:35 AM
  3. Simplify the formula
    By Ivor in forum Excel General
    Replies: 4
    Last Post: 02-15-2010, 12:53 PM
  4. Simplify a Formula
    By alan_stephen75@ in forum Excel General
    Replies: 8
    Last Post: 02-20-2008, 09:32 AM
  5. [SOLVED] Simplify Formula Help
    By Daveo in forum Excel General
    Replies: 4
    Last Post: 09-12-2005, 02:05 PM
  6. Simplify formula
    By Luke in forum Excel Formulas & Functions
    Replies: 38
    Last Post: 05-06-2005, 03:06 AM
  7. [SOLVED] How to simplify this IF formula
    By Bojana in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-14-2005, 12:03 PM

Tags for this Thread

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