+ Reply to Thread
Results 1 to 4 of 4

Complex rounding in a formula

Hybrid View

  1. #1
    Forum Contributor heytherejem's Avatar
    Join Date
    07-06-2017
    Location
    Hampshire, England
    MS-Off Ver
    2016
    Posts
    152

    Complex rounding in a formula

    So I have to work out how long a customer is with us till they cancel a policy by using a combination of information, including policy status, start date and cancellation date.

    I've used a formula
    =IFERROR(ROUND(SUM((H2-B2)/30),0),"Live")

    This takes the cancelled date from the start date to give the total number of dates the policy was live, divides by 30 to give an approximate month, and rounds it to a whole number. The iferror just shows that the policy hasn't cancelled.

    The thing is - if the number of days the policy was live is more than 14 - this is 0.4666667 when divided by 30 - so it would round to 0. We want to round anything greater than 0.466667 to 1 so we count this as a cancellation. I doubt I can do this in the same formula as above - I probably need to do something in a new column - but I have no idea.

    I have attached some sample data which has my workings.

    Anyone super clever - can you help?
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,077

    Re: Complex rounding in a formula

    This doesnt solve your problem but makes the calculation look better.

    Remove the SUM from the formula
    You only have one parameter that's H2-B2
    So you're SUMming (H2-B2) with...absolutely nothing.
    That's like saying SUM(3), no point. It's just 3.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,077

    Re: Complex rounding in a formula

    Does this work?

    in I2
    =IFERROR(IF(H2-B2<=14,1,ROUND((H2-B2)/30,0)),"Live")

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,939

    Re: Complex rounding in a formula

    try
    I2=IFERROR(ROUND((H2-B2)/30+0.033334,0),"Live")
    OR
    =IFERROR(ROUND((H2-B2+1)/30,0),"Live")
    Last edited by samba_ravi; 02-26-2018 at 01:04 PM.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

+ 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] Complex Retail Rounding Structure
    By sabin348 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-13-2017, 05:11 PM
  2. [SOLVED] Complex Rounding Rules Based on Multiple Criteria
    By sabin348 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-12-2017, 11:05 AM
  3. [SOLVED] Complex formula getting moer complex
    By Trebor777 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-02-2017, 01:39 PM
  4. Complex rounding and concatenate formula to be set to 1 decimal
    By belpal in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-02-2015, 10:36 AM
  5. complex ROUNDING functions.
    By kendrijami in forum Excel General
    Replies: 10
    Last Post: 10-19-2010, 06:39 AM
  6. Having trouble with complex ROUNDING functions.
    By kendrijami in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 10-19-2010, 04:20 AM
  7. Complex SUM with ROUNDing - all in one cell possible?
    By daleppk in forum Excel General
    Replies: 8
    Last Post: 02-27-2009, 10:27 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