View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Trevor Shuttleworth Trevor Shuttleworth is offline
external usenet poster
 
Posts: 1,089
Default Function to calculate based on a portions of a number

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.