Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a user who needs to create codes for locks. Here is what he wants to do. He has numbers listed in a column. He wants to find the lowest number in the column, then subtract that number from the next lowest number and so on. I believe he wants to find as many results as possible. I hope this makes sense. Does anyone have any ideas?
Thanks so very much!

Well if they're in column A,
=SMALL(A:A,1) will give you the smallest
=SMALL(A:A,2) will give the second smallest, etc.
So for one minus the other:
=SMALL(A:A,1)-SMALL(A:A,2)I'm not sure if the user has specified exact enough requirements though. Any chance of bit more detail? Thanks!

jon: Have you got your values reversed?
"find the lowest number in the column, then subtract that number from the next lowest number and so on.
=SMALL(A:A,2)-SMALL(A:A,1)
actress (I assume): For ease of entering this formula, assuming the values begin in Row 1, you could use:
=SMALL(A:A,ROW()+1)-SMALL(A:A,1)
ROW() will pick up the current Row number (1) and adding 1 gives you 2. As you drag it down, ROW() will increment each time, so you'll get 2, 3, 4 as the k arguments for the SMALL function.
You can easily adjust the starting value by using things like ROW()-1, ROW()+2, etc. to compensate for the actual starting row and still get 2, 3, 4 etc.

Thanks for your help. It isn't exactly what he is looking for. My fault. I am having a hard time explaining it. So sorry. Here is what he wrote me. Perhaps this will help.
Jen,
The #'s in the boxes are the variables. the #'s below are the answers I am looking to get with the formula. 1+4=5, 1+4+2=7, 1+4+2+2=9 for row one. 0+2=2, 0+2+6=8, etc.
Thanks,
9 X
7 6
5 2
1 0
2 X
2 4
4 2
1 0

I'm not sure you've made it much clearer, at least not to me.
re: The #'s in the boxes are the variables.
What boxes?
re: 1+4=5, 1+4+2=7, 1+4+2+2=9 for row one
Those numbers appear to be the values in Column 1, not Row 1.
In any case, to get 1, 5, 7, 9 from 1, 4, 2, 2 try this:
Put 1, 4, 2, 2 in A2:A5
Leave B1 empty
Put =A2+B1 in B2 and drag it down.
You'll get 1, 5, 7, 9 in B2:B5

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |