+ Reply to Thread
Results 1 to 9 of 9

Multiplying unil greater than a number?

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2010
    Posts
    14

    Multiplying unil greater than a number?

    Hello,
    I'm trying to create a formula that will multiply a cell H4 until it is greater than another cell H3.
    Then, it will take the difference, and divide it by the number it multiplied H4 by...


    So if cell H3 was $118.76, and H4 was 35, it would calculate that 35*4= $140, therefore 140-118.76 is 21.24, and divide that by 4 to produce 5.31

    Thoughts?
    Thanks!!!
    Last edited by ninj5; 01-22-2013 at 01:22 PM. Reason: corrected the numbers in cells

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Multiplying unil greater than a number?

    You could try:

    =(H4-MOD(H3,H4))/(INT(H3/H4)+1)

    - Moo

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Multiplying unil greater than a number?

    Not quite sure where this is going...but

    H3: 138.5
    H4: 35

    This regular formula does what you're asking for:
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    01-22-2013
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Multiplying unil greater than a number?

    Thanks Moo for the quick response!
    Although I'm not sure it worked...

    I have H11 = 118.76 and H12= 35
    It should have produced:

    140-118.76 =21.24 /4 = 5.31
    Instead of 5.31 it produced 12.935... Thoughts?

  5. #5
    Registered User
    Join Date
    01-22-2013
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Multiplying unil greater than a number?

    Quote Originally Posted by Ron Coderre View Post
    Not quite sure where this is going...but

    H3: 138.5
    H4: 35

    This regular formula does what you're asking for:
    Please Login or Register  to view this content.
    Is that something you can work with?
    Thanks for the help! the formula you provided results in: $1.05...

    I probably should have put in the correct numbers in the first post. Sorry about that...
    H11 is 118.76 and H12 is 35

    The formula should result in $5.31
    This is because 35 times 4 is 140, and that minus H11 is 21.24. That divided by 4 is 5.31

    I'm nowhere near an expert with formulas so this helps me a lot... looking up MOD and ROUNDUP now...
    Last edited by ninj5; 01-22-2013 at 01:24 PM.

  6. #6
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Multiplying unil greater than a number?

    When I make the changes according to your most recent post and put 118.76 in cell H11, and 35 in H12, using this formula in any blank cell:
    =(H12-MOD(H11,H12))/(INT(H11/H12)+1) comes out to 5.31

    You must have typed something in incorrectly?

    - Moo

  7. #7
    Registered User
    Join Date
    01-22-2013
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Multiplying unil greater than a number?

    Quote Originally Posted by Moo the Dog View Post
    You could try:

    =(H4-MOD(H3,H4))/(INT(H3/H4)+1)

    - Moo
    Hey Moo, Your first part of that formula was great! =(H4-MOD(H3,H4)) produces 21.24.
    Not sure why INT(H3/H4+1) produces 2... but it should produce 4.

    Gonna try and look up the INT functioning now...

  8. #8
    Registered User
    Join Date
    01-22-2013
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Multiplying unil greater than a number?

    Quote Originally Posted by ninj5 View Post
    Hey Moo, Your first part of that formula was great! =(H4-MOD(H3,H4)) produces 21.24.
    Not sure why INT(H3/H4+1) produces 2... but it should produce 4.

    Gonna try and look up the INT functioning now...
    Yes, you are correct! I copied and pasted instead of looking at the correct cells...
    You did it!
    Thanks again for your help!

  9. #9
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Multiplying unil greater than a number?

    Glad to help.

    The INT function simply returns the integer (WHOLE NUMBER) value of a number. For instance, =INT(4.53) will result in 4. =INT(5/2) will result in 2.

    The MOD function [=MOD(number, divisor)] returns the REMAINDER of a division formula. For instance =MOD(5,2) will result in 1, because 2 goes into 5 twice, with a remainder of 1.

    Hope that helps!

    - Moo

  10. #10
    Registered User
    Join Date
    01-22-2013
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Multiplying unil greater than a number?

    Quote Originally Posted by Moo the Dog View Post
    Glad to help.

    The INT function simply returns the integer (WHOLE NUMBER) value of a number. For instance, =INT(4.53) will result in 4. =INT(5/2) will result in 2.

    The MOD function [=MOD(number, divisor)] returns the REMAINDER of a division formula. For instance =MOD(5,2) will result in 1, because 2 goes into 5 twice, with a remainder of 1.

    Hope that helps!

    - Moo
    Yes, this helped a great deal. Thanks again!

+ 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