iNCREMENTAL SUBTRACTION

cjlast72

New Member
Joined
May 19, 2015
Messages
3
So here's the question I haven't been able to figure out.

I'm trying to build a master pin chart for locksmith purposes. One of the steps is to subtract the smallest to the next largest number. For example, if the cuts for the three keys are 545, 768, and 332.


Lined up
545
768
332

The first column would be like B1, C1, and D1. I would fist subtract 5 from 3, then 7 from 5. How do I do that on Excel?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Quick clarification, subtracting 5 from 3 would result in -2, or did you mean subtract 3 from 5?
 
Upvote 0
Just absolute numbers. When I do it on the handwritten worksheet, I will look at the first column of key cuts. If the three cuts are the 7, the 5, and the 3, I will first subtract 3 from 5, and get a 2. Then I will subtract the 5 from the 7, and get another 2. The sums, (the two 2s) will be top pins stacked one on tp of the other in the chamber to accommodate the different cuts of the different keys. It doesn't matter of I am subtracting 3 from 5 or 5 from 3, the only acceptable answer is 2. I've already figured the ABS function that eliminates negative numbers, it's more about the incremental subtraction from the smallest number to the next largest and so forth.
 
Upvote 0
=ABS(B$1-LARGE(B$2:B$3,3-ROW(A1)))

Copy down and across.

<b>Sheet1</b><br /><br /><table border="1" cellspacing="0" cellpadding="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:64px;" /><col style="width:64px;" /><col style="width:64px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >B</td><td >C</td><td >D</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td style="text-align:right; ">5</td><td style="text-align:right; ">4</td><td style="text-align:right; ">5</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td style="text-align:right; ">7</td><td style="text-align:right; ">6</td><td style="text-align:right; ">8</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td style="text-align:right; ">3</td><td style="text-align:right; ">3</td><td style="text-align:right; ">2</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td > </td><td > </td><td > </td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >5</td><td > </td><td > </td><td > </td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >6</td><td > </td><td > </td><td > </td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >7</td><td style="text-align:right; ">2</td><td style="text-align:right; ">1</td><td style="text-align:right; ">3</td></tr><tr style="height:18px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >8</td><td style="text-align:right; ">2</td><td style="text-align:right; ">2</td><td style="text-align:right; ">3</td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b>Spreadsheet Formulas</b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Formula</td></tr><tr><td >B7</td><td >=ABS(B$1-LARGE<span style=' color:008000; '>(B$2:B$3,3-ROW<span style=' color:#0000ff; '>(A1)</span>)</span>)</td></tr><tr><td >C7</td><td >=ABS(C$1-LARGE<span style=' color:008000; '>(C$2:C$3,3-ROW<span style=' color:#0000ff; '>(B1)</span>)</span>)</td></tr><tr><td >D7</td><td >=ABS(D$1-LARGE<span style=' color:008000; '>(D$2:D$3,3-ROW<span style=' color:#0000ff; '>(C1)</span>)</span>)</td></tr><tr><td >B8</td><td >=ABS(B$1-LARGE<span style=' color:008000; '>(B$2:B$3,3-ROW<span style=' color:#0000ff; '>(A2)</span>)</span>)</td></tr><tr><td >C8</td><td >=ABS(C$1-LARGE<span style=' color:008000; '>(C$2:C$3,3-ROW<span style=' color:#0000ff; '>(B2)</span>)</span>)</td></tr><tr><td >D8</td><td >=ABS(D$1-LARGE<span style=' color:008000; '>(D$2:D$3,3-ROW<span style=' color:#0000ff; '>(C2)</span>)</span>)</td></tr></table></td></tr></table> <br /><br /><span style="font-family:Arial; font-size:9pt; font-weight:bold;background-color:#ffffff; color:#000000; ">Excel tables to the web >> </span>
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top