Function to calculate based on a portions of a number
Trevor: Thanks for the reply but it does not seem to quite work, Maybe if I
include this chart to show what results I am tring to achive:
Column A = input quantity varies and will be whole numbers only
Column B = input quantity varies and will be whole numbers only (I used 100
in this example for ease of detail)
Columns C,D,E = Desired results based on Qty in A & B
A B C D E
1 100 100 0 0
2 100 50 50 0
3 100 33 33 33
4 100 133 33 33
5 100 83 83 33
6 100 66 66 66
7 100 166 66 66
8 100 116 116 66
17 380 ? ? ?
The last entry (17 and 380) is an example of what could be.
"Trevor Shuttleworth" wrote:
Not sure I quite follow but, if I have understood:
=IF(A1/3=INT(A1/3), (A1/3)*B1, IF(A1/3-INT(A1/3)=1, (A1/3)*B1+B1,
(A1/3)*B1+B1/2))
A1/3 = Integer (A1/3) if A1 is divisible by 3
A1/3 - Integer (A1/3) gives the remainder = 1 or 2
So, the first part calculates a value based on A1 being divisible by 3.
The second part works out the value dependent on the remainder
I'll leave you to work out the Column D values; should be a similar process
Regards
Trevor
"Sparky13" wrote in message
...
How would I write a formula to produce various results in differant cells
based on a portion of a number in another cell. Excel 2003
Cell A contains a variable number.
Cell B also containes a variable number.
I need to calculate:
Cell C results need to be based on 1/3rd of Cell A x Cell B, if Cell A is
evenly divided by 3. This part is not a problem (B/(A/3). If Cell A can't
be
evenly divided than: Cell A results need to be (B/(A/3) + 100% of cell B
if
the remainder is "1" or 50% of Cell B if the remainder is "2" .
Than comes Cell D: This result needs to be (B/(A/3) + 0% if remainder is
"1"
and 50% of cell B if remained is "2"
Than comes cell C: This result needs to be (B/(A/3) only on the hole
number
result of A/3.
|