Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is something else I desperately need help with at work, but just
can not figure it out. I THINK it is an iteration problem, but I am not su Cells A1:A500 contain numbers, all of them 5 or 6 figures. Cell A501 contains the total of all those numbers, a simple autosum. Cell B1 contains a number. The problem: When you enter a number in B1, all of the numbers in A1:A500 are increased or decreased by the same amount, so that A501 = B1. If it helps, these are all positive numbers (dollar amounts), and the increments and decrements will be very small, maybe a few hundred or a thousand dollars or so. None of them will fly off into the negatives or anything like that. I am thinking of it taking the total of the current numbers and finding the difference between that and the amount in B1. Then take that difference and add or subtract it from the numbers in A1:A500... something like that. But I just can not seem to nail it. Thanks very much, Ron M. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In B1, enter:
=A1+($C$1-SUM($A$1:$A$25))/ROWS($A$1:$A$25) See example: http://cjoint.com/?gks6HbAbgZ HTH -- AP a écrit dans le message de news: ... Sorry, I forgot to include something. I apologize: The "adjusted" amounts need to appear in another column. Say the number in B1 can be in C1 instead. The "adjusted" amounts of the numbers in A1:A500 need to appear in B1:B500. Again, I apologize. Thanks, Ron M. wrote: This is something else I desperately need help with at work, but just can not figure it out. I THINK it is an iteration problem, but I am not su Cells A1:A500 contain numbers, all of them 5 or 6 figures. Cell A501 contains the total of all those numbers, a simple autosum. Cell B1 contains a number. The problem: When you enter a number in B1, all of the numbers in A1:A500 are increased or decreased by the same amount, so that A501 = B1. If it helps, these are all positive numbers (dollar amounts), and the increments and decrements will be very small, maybe a few hundred or a thousand dollars or so. None of them will fly off into the negatives or anything like that. I am thinking of it taking the total of the current numbers and finding the difference between that and the amount in B1. Then take that difference and add or subtract it from the numbers in A1:A500... something like that. But I just can not seem to nail it. Thanks very much, Ron M. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you want the results in another column, say column D then:
Sub summit() v = cells(1, "B").Value / cells(501, "A").Value For i = 1 To 500 cells(i, "D").Value = cells(i, "A").Value * v Next End Sub and the cells in column A will not be over-written -- Gary''s Student " wrote: Sorry, I forgot to include something. I apologize: The "adjusted" amounts need to appear in another column. Say the number in B1 can be in C1 instead. The "adjusted" amounts of the numbers in A1:A500 need to appear in B1:B500. Again, I apologize. Thanks, Ron M. wrote: This is something else I desperately need help with at work, but just can not figure it out. I THINK it is an iteration problem, but I am not su Cells A1:A500 contain numbers, all of them 5 or 6 figures. Cell A501 contains the total of all those numbers, a simple autosum. Cell B1 contains a number. The problem: When you enter a number in B1, all of the numbers in A1:A500 are increased or decreased by the same amount, so that A501 = B1. If it helps, these are all positive numbers (dollar amounts), and the increments and decrements will be very small, maybe a few hundred or a thousand dollars or so. None of them will fly off into the negatives or anything like that. I am thinking of it taking the total of the current numbers and finding the difference between that and the amount in B1. Then take that difference and add or subtract it from the numbers in A1:A500... something like that. But I just can not seem to nail it. Thanks very much, Ron M. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Iteration is not needed. Just scale each entry in A1 thru A500 by the ratio
of B1 to A501: Sub summit() v = cells(1, "B").Value / cells(501, "A").Value For i = 1 To 500 cells(i, "A").Value = cells(i, "A").Value * v Next End Sub -- Gary''s Student " wrote: This is something else I desperately need help with at work, but just can not figure it out. I THINK it is an iteration problem, but I am not su Cells A1:A500 contain numbers, all of them 5 or 6 figures. Cell A501 contains the total of all those numbers, a simple autosum. Cell B1 contains a number. The problem: When you enter a number in B1, all of the numbers in A1:A500 are increased or decreased by the same amount, so that A501 = B1. If it helps, these are all positive numbers (dollar amounts), and the increments and decrements will be very small, maybe a few hundred or a thousand dollars or so. None of them will fly off into the negatives or anything like that. I am thinking of it taking the total of the current numbers and finding the difference between that and the amount in B1. Then take that difference and add or subtract it from the numbers in A1:A500... something like that. But I just can not seem to nail it. Thanks very much, Ron M. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Simple problem, simple formula, no FUNCTION ! | Excel Worksheet Functions | |||
Iteration problem (Excel 2002) | Excel Worksheet Functions | |||
Help requested for Excel Iteration problem | Excel Discussion (Misc queries) | |||
Frustrating Boolean/loop iteration problem | Excel Programming | |||
Frustrating Boolean/loop iteration problem | Excel Programming |