Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 24
Default Function to calculate based on a portions of a number

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.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 24
Default 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.




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Function to calculate based on a portions of a number

I don't see how you get these values from your definition of the
problem in your first posting. I entered the values in columns A and B
and tried this formula:

=IF(MOD(A1,3)=0,B1/A1*3,B1/A1*3+B1/MOD(A1,3))

but this gave me the following values in column C:

400
200
100
175
110
50
142.8571429
87.5

Take the first case: A1 is not divisible by 3 (has a remainder of 1),
and you say in this case:

Cell A results need to be (B/(A/3) + 100% of cell B if the remainder is "1"


I think you mean Cell C (never mind) and if we work this through with
A1=1, you have B1*3 + B1, giving 400.

Can you either revise your table values or re-state the problem
accurately.

Hope this helps.

Pete

Sparky13 wrote:
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.





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 24
Default Function to calculate based on a portions of a number

Lets see if I can explain this better.
Condition 1) If column A = 1 than 100% of column B goes to Column C,
Condition 2) If column A = 2 than 50% of column B goes to columns C & D,
Condition 3) If column A = 3 than 33% of colmun B goes to columns C,D & E
Condition 4) if column A is greater than 3, than or every multiple of (3) in
column A I need to meet condition 3 plus the remainder of column A after
dividing by 3 needs to meet conditions 2 or 3.

Does this make sense? (Clear as chocolate milk)


"Pete_UK" wrote:

I don't see how you get these values from your definition of the
problem in your first posting. I entered the values in columns A and B
and tried this formula:

=IF(MOD(A1,3)=0,B1/A1*3,B1/A1*3+B1/MOD(A1,3))

but this gave me the following values in column C:

400
200
100
175
110
50
142.8571429
87.5

Take the first case: A1 is not divisible by 3 (has a remainder of 1),
and you say in this case:

Cell A results need to be (B/(A/3) + 100% of cell B if the remainder is "1"


I think you mean Cell C (never mind) and if we work this through with
A1=1, you have B1*3 + B1, giving 400.

Can you either revise your table values or re-state the problem
accurately.

Hope this helps.

Pete

Sparky13 wrote:
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.







  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,089
Default Function to calculate based on a portions of a number

Sorry, can't get my head round this ... tried and tried but no good


"Sparky13" wrote in message
...
Lets see if I can explain this better.
Condition 1) If column A = 1 than 100% of column B goes to Column C,
Condition 2) If column A = 2 than 50% of column B goes to columns C & D,
Condition 3) If column A = 3 than 33% of colmun B goes to columns C,D & E
Condition 4) if column A is greater than 3, than or every multiple of (3)
in
column A I need to meet condition 3 plus the remainder of column A after
dividing by 3 needs to meet conditions 2 or 3.

Does this make sense? (Clear as chocolate milk)


"Pete_UK" wrote:

I don't see how you get these values from your definition of the
problem in your first posting. I entered the values in columns A and B
and tried this formula:

=IF(MOD(A1,3)=0,B1/A1*3,B1/A1*3+B1/MOD(A1,3))

but this gave me the following values in column C:

400
200
100
175
110
50
142.8571429
87.5

Take the first case: A1 is not divisible by 3 (has a remainder of 1),
and you say in this case:

Cell A results need to be (B/(A/3) + 100% of cell B if the remainder is
"1"


I think you mean Cell C (never mind) and if we work this through with
A1=1, you have B1*3 + B1, giving 400.

Can you either revise your table values or re-state the problem
accurately.

Hope this helps.

Pete

Sparky13 wrote:
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.







  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 24
Default Function to calculate based on a portions of a number

Gentlemen: Thank you for your assistance. Youe suggestion did help me create
a workaround formula (see below FYI). It is a bit larger than I was hoping
for but it does work. Now I just need to work out the negitive number aspects.
Thanks again

=IF(BL22=1,BL23,IF(BL22=2,BL23/2,IF(BL22=3,BL23/3,IF(AND(BL223,(BL22-INT((BL22/3))*3)=1),BL23,IF(AND(BL223,(BL22-INT((BL22/3))*3)=2),BL23/2,0))+BB38)))

"Sparky13" wrote:

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM
Number value based on date function Neil M Excel Worksheet Functions 2 January 12th 06 12:57 AM
Using the Indirect function with a sheet number instead of a sheet name JDB Excel Worksheet Functions 5 December 31st 05 03:03 PM
Function to calculate the number of years, months and days between Vicky Excel Worksheet Functions 2 July 15th 05 04:27 AM


All times are GMT +1. The time now is 06:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"