+ Reply to Thread
Results 1 to 5 of 5

Calculating Innings Pitched

  1. #1
    Registered User
    Join Date
    12-26-2009
    Location
    Moore, Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    20

    Calculating Innings Pitched

    I am having a problem calculating innings pictched. I am using the following formula:

    =DOLLARFR(SUMPRODUCT(INT(D69:D73)+DOLLARDE(MOD(D69:D73,1),3)),3)

    When I calculate the following with the above formula:

    D69 = 7
    D70 = 0
    D71 = 0.1
    D72 = 0.1
    D73 = 0.1

    I get a total of 7.3, but what I should be getting is 8. There are 3 outs in an inning so in my thoughts I should never see 7.3 it should drive it to the next number as in 8.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    12,978

    Re: Calculating Innings Pitched


    Can you explain in words what that formula was intended to do?

    1. Your use of the MOD() is in error (twice):
    a. the remainder of any number divided by one is always going to be zero
    b. it looks like you intended to calc the sum of the range D69:D73 but, without the SUM() all you really have is the first number in the range, vis., 7. Therefore, the remainder of 7/1 is 0.

    2. Your use of the INT() is also in error for the same reason as #1.b. above: INT(7)=7
    3. What are you trying to calc with the DOLLARx()'s?
    4. What do the numbers in the range signify? (counts of what?)

    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    12-26-2009
    Location
    Moore, Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Calculating Innings Pitched

    The intent is to total the range from D69:D73. if the toal 7.3 it would roll to 8. If the total was 7.2 then it would show 7.2. Currently the formula (which I got from another person on this forum) provides a total of 7.3 instead of 8. If you deduct 0.1 from one of the numbers it gives me 7.2 as I was hoping for it to. Does this help?
    Last edited by shg; 05-29-2010 at 12:50 PM. Reason: deleted spurious quote

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,762

    Re: Calculating Innings Pitched

    You can get some "rounding errors" with those type of formulas. One solution would be to put the SUMPRODUCT part in a ROUND function, rounding to a large number of decimal places, i.e. like this

    =DOLLARFR(ROUND(SUMPRODUCT(INT(D69:D73)+DOLLARDE(MOD(D69:D73,1),3)),8),3)

    although you can simplify a little and use this for the same result

    =DOLLARFR(ROUND(SUMPRODUCT(D69:D73+MOD(D69:D73,1)*7/3),8),3)

    ....or even

    =DOLLARFR(ROUND(SUMPRODUCT(DOLLARDE(D69:D73+0,3)),8),3)

    Note that all 3 of these work in Excel 2007 but only the 2nd will work in earlier versions (and you need Analysis ToolPak installed)
    Last edited by daddylonglegs; 05-29-2010 at 11:08 AM.

  5. #5
    Registered User
    Join Date
    12-26-2009
    Location
    Moore, Oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Calculating Innings Pitched

    Thank you very much

+ 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