# Need help with a (probably) easy math equation (using Excel)

**URL:** <https://boards.straightdope.com/t/need-help-with-a-probably-easy-math-equation-using-excel/449356>\
**Category:** Factual Questions\
**Created:** [May 14, 2008, 11:23pm UTC](https://boards.straightdope.com/t/need-help-with-a-probably-easy-math-equation-using-excel/449356 "2008-05-14T23:23:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Whack-a-Mole](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/whack-a-mole/32/141_2.png) [@Whack-a-Mole](https://boards.straightdope.com/u/Whack-a-Mole)\
**Post date:** [May 14, 2008, 11:23pm UTC](https://boards.straightdope.com/t/need-help-with-a-probably-easy-math-equation-using-excel/449356/1 "2008-05-14T23:23:38Z")

</div>

I cannot help but suspect the following has a simple solution I should know but for the life of me I can’t figure it out.

Say I have cases of items that come 6/case. When sold as a case they cost $9 ($1.50/unit). When I sell them individually they go for $2/unit (or $12 for the whole case without discount).

Now, assume someone wants to buy 87 units. That is 14 cases (84 units) at $1.50 each and 3 units left over at $2 each.

While not difficult to just wangle the numbers I need to put it into a spreadsheet so those even less mathematically inclined than I am (scary huh?) can just type in the unit amount and get the answer handed to them.

Any ideas how best to go about this in Excel?

---

<div class="post-metadata">

**Author:** ![Simplicio](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@Simplicio](https://boards.straightdope.com/u/Simplicio)\
**Post date:** [May 14, 2008, 11:39pm UTC](https://boards.straightdope.com/t/need-help-with-a-probably-easy-math-equation-using-excel/449356/2 "2008-05-14T23:39:14Z")

</div>

Try (using the numbers for your examples), A=87 mod 6 (I think thats the command for modular division in Excel but I don’t have the program here to check, if it doesn’t work just search for “modular” in the help file).

A will then be the number of individual units you want. Then B=(87-A)/6 gives the number of cases.

ETA: actually, googled it. Command should be A=Mod(87,6)

---

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [May 14, 2008, 11:42pm UTC](https://boards.straightdope.com/t/need-help-with-a-probably-easy-math-equation-using-excel/449356/3 "2008-05-14T23:42:51Z")

</div>

The above works, or you can do TRUNC(87/6) to get the number of cases and MOD(87,6) to get the number of individual items.

---

<div class="post-metadata">

**Author:** ![Whack-a-Mole](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/whack-a-mole/32/141_2.png) [@Whack-a-Mole](https://boards.straightdope.com/u/Whack-a-Mole)\
**Post date:** [May 14, 2008, 11:43pm UTC](https://boards.straightdope.com/t/need-help-with-a-probably-easy-math-equation-using-excel/449356/4 "2008-05-14T23:43:59Z")

</div>

Fast answers! Thanks you two!

---

<div class="post-metadata">

**Author:** ![Oslo\_Ostragoth](https://avatars.discourse-cdn.com/v4/letter/o/a9a28c/32.png) [@Oslo\_Ostragoth](https://boards.straightdope.com/u/Oslo_Ostragoth)\
**Post date:** [May 15, 2008, 4:49am UTC](https://boards.straightdope.com/t/need-help-with-a-probably-easy-math-equation-using-excel/449356/5 "2008-05-15T04:49:12Z")

</div>

20 minutes for the absolute answer to a question on the SDMB - is that a record?

---

<div class="post-metadata">

**Author:** ![CookingWithGas](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cookingwithgas/32/485_2.png) [@CookingWithGas](https://boards.straightdope.com/u/CookingWithGas)\
**Post date:** [May 15, 2008, 12:29pm UTC](https://boards.straightdope.com/t/need-help-with-a-probably-easy-math-equation-using-excel/449356/6 "2008-05-15T12:29:14Z")

</div>

[QUOTE=Oslo Ostragoth]  
20 minutes for the absolute answer to a question on the SDMB - is that a record?  
[/QUOTE]  
I can’t give you a cite but that is hardly the record.
