Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ali Ali is offline
external usenet poster
 
Posts: 80
Default return a minimum value of 1, except when multiplied by an empty ce

Hi there. i have a sheet containing various stock items, and in order to
calculate the amount per item that is needed per hotel, I have a cell where a
per person per day amount (in brackets) is multiplied by a set unit for that
ingredient
A B C D E
Hotel 1 Hotel 2 Hotel 3
1) Item Unit (6.1) (1.38) (9.22)
2) Coco 0.2 1 1 2
3) Custard 0.25 2 2 2
4) Crème 0.1 1 1 1

So for example cell C2 = $C$1*B2
Because the minimum needed for just 1 guest cannot be less than one i have
changed all the formulas to be example
C2 = Max(1,Sum($C$1*B2))
this is great as it gives me a minimum of 1 for certain items that would
normally be rounded off to zero. This is great.
However, my problem is that certain items still have UNITS that need to be
determined. So example Creme, cell B4 would still be empty as the per person
per day amount is still being calculated.
I would like these cells to reflect a zero (as they are multiplying empty
cells) rather than the minimum of 1. if it is minimum 1 the stores will go
ahead and order this, thinking it is correct, rather than if it shows a zero,
the store man will realise there is a problem and double check the spread
sheets, calculate the missing unit and then order.
Hope some-one can assist.
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default return a minimum value of 1, except when multiplied by an empty ce

On Sun, 22 Mar 2009 02:39:00 -0700, Ali wrote:

Hi there. i have a sheet containing various stock items, and in order to
calculate the amount per item that is needed per hotel, I have a cell where a
per person per day amount (in brackets) is multiplied by a set unit for that
ingredient
A B C D E
Hotel 1 Hotel 2 Hotel 3
1) Item Unit (6.1) (1.38) (9.22)
2) Coco 0.2 1 1 2
3) Custard 0.25 2 2 2
4) Crème 0.1 1 1 1

So for example cell C2 = $C$1*B2
Because the minimum needed for just 1 guest cannot be less than one i have
changed all the formulas to be example
C2 = Max(1,Sum($C$1*B2))
this is great as it gives me a minimum of 1 for certain items that would
normally be rounded off to zero. This is great.
However, my problem is that certain items still have UNITS that need to be
determined. So example Creme, cell B4 would still be empty as the per person
per day amount is still being calculated.
I would like these cells to reflect a zero (as they are multiplying empty
cells) rather than the minimum of 1. if it is minimum 1 the stores will go
ahead and order this, thinking it is correct, rather than if it shows a zero,
the store man will realise there is a problem and double check the spread
sheets, calculate the missing unit and then order.
Hope some-one can assist.
Thanks


I don't understand some of your logic as your results do not compute from the
formula given. For example,

C2: 6.1*0.2 = 1.22 not 1
E3: 9.22*.25 = 2.305 not 2

And also the SUM function is completely unnecessary.

So it would appear you are rounding your results. Is that what you really want
to do? Or do you want to round UP to the next integer?

But, in general, to make a special case if the Unit is not filled in, you can
use a construct such as:

=IF($B3="",0,MAX(1,C$2*$B3))

If you want to round to the closest integer, then:

=IF($B3="",0,ROUND(MAX(1,C$2*$B3),0))

If you want to round up to the next integer, then:

=IF($B3="",0,CEILING(MAX(1,C$2*$B3),1))

--ron
  #3   Report Post  
Posted to microsoft.public.excel.misc
Ali Ali is offline
external usenet poster
 
Posts: 80
Default return a minimum value of 1, except when multiplied by an empt


Hi Ron
Sorry if you did not get all the correct info, but your answer has still
helped and it works fine. many thanks
Ali
"Ron Rosenfeld" wrote:

On Sun, 22 Mar 2009 02:39:00 -0700, Ali wrote:

Hi there. i have a sheet containing various stock items, and in order to
calculate the amount per item that is needed per hotel, I have a cell where a
per person per day amount (in brackets) is multiplied by a set unit for that
ingredient
A B C D E
Hotel 1 Hotel 2 Hotel 3
1) Item Unit (6.1) (1.38) (9.22)
2) Coco 0.2 1 1 2
3) Custard 0.25 2 2 2
4) Crème 0.1 1 1 1

So for example cell C2 = $C$1*B2
Because the minimum needed for just 1 guest cannot be less than one i have
changed all the formulas to be example
C2 = Max(1,Sum($C$1*B2))
this is great as it gives me a minimum of 1 for certain items that would
normally be rounded off to zero. This is great.
However, my problem is that certain items still have UNITS that need to be
determined. So example Creme, cell B4 would still be empty as the per person
per day amount is still being calculated.
I would like these cells to reflect a zero (as they are multiplying empty
cells) rather than the minimum of 1. if it is minimum 1 the stores will go
ahead and order this, thinking it is correct, rather than if it shows a zero,
the store man will realise there is a problem and double check the spread
sheets, calculate the missing unit and then order.
Hope some-one can assist.
Thanks


I don't understand some of your logic as your results do not compute from the
formula given. For example,

C2: 6.1*0.2 = 1.22 not 1
E3: 9.22*.25 = 2.305 not 2

And also the SUM function is completely unnecessary.

So it would appear you are rounding your results. Is that what you really want
to do? Or do you want to round UP to the next integer?

But, in general, to make a special case if the Unit is not filled in, you can
use a construct such as:

=IF($B3="",0,MAX(1,C$2*$B3))

If you want to round to the closest integer, then:

=IF($B3="",0,ROUND(MAX(1,C$2*$B3),0))

If you want to round up to the next integer, then:

=IF($B3="",0,CEILING(MAX(1,C$2*$B3),1))

--ron

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default return a minimum value of 1, except when multiplied by an empt

Hi,

If Max(1,Sum($C$1*B2)) works except for the blank cells then you can use

=IF($B2,MAX(1,C$1*$B2),0)

No need to SUM(C1*B2) here or in any formula.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Ali" wrote:


Hi Ron
Sorry if you did not get all the correct info, but your answer has still
helped and it works fine. many thanks
Ali
"Ron Rosenfeld" wrote:

On Sun, 22 Mar 2009 02:39:00 -0700, Ali wrote:

Hi there. i have a sheet containing various stock items, and in order to
calculate the amount per item that is needed per hotel, I have a cell where a
per person per day amount (in brackets) is multiplied by a set unit for that
ingredient
A B C D E
Hotel 1 Hotel 2 Hotel 3
1) Item Unit (6.1) (1.38) (9.22)
2) Coco 0.2 1 1 2
3) Custard 0.25 2 2 2
4) Crème 0.1 1 1 1

So for example cell C2 = $C$1*B2
Because the minimum needed for just 1 guest cannot be less than one i have
changed all the formulas to be example
C2 = Max(1,Sum($C$1*B2))
this is great as it gives me a minimum of 1 for certain items that would
normally be rounded off to zero. This is great.
However, my problem is that certain items still have UNITS that need to be
determined. So example Creme, cell B4 would still be empty as the per person
per day amount is still being calculated.
I would like these cells to reflect a zero (as they are multiplying empty
cells) rather than the minimum of 1. if it is minimum 1 the stores will go
ahead and order this, thinking it is correct, rather than if it shows a zero,
the store man will realise there is a problem and double check the spread
sheets, calculate the missing unit and then order.
Hope some-one can assist.
Thanks


I don't understand some of your logic as your results do not compute from the
formula given. For example,

C2: 6.1*0.2 = 1.22 not 1
E3: 9.22*.25 = 2.305 not 2

And also the SUM function is completely unnecessary.

So it would appear you are rounding your results. Is that what you really want
to do? Or do you want to round UP to the next integer?

But, in general, to make a special case if the Unit is not filled in, you can
use a construct such as:

=IF($B3="",0,MAX(1,C$2*$B3))

If you want to round to the closest integer, then:

=IF($B3="",0,ROUND(MAX(1,C$2*$B3),0))

If you want to round up to the next integer, then:

=IF($B3="",0,CEILING(MAX(1,C$2*$B3),1))

--ron

  #5   Report Post  
Posted to microsoft.public.excel.misc
Ali Ali is offline
external usenet poster
 
Posts: 80
Default return minimum value of 1

Hi Ron
Just to make this more difficult. i am using =IF($B3="",0,Max,(1,C$2*$B3))
which is working but now have extra hassle. It is returning a minimum of 1
except if cell B3 is empty which is great. however, I have a problem as
occassionally cell C2 is Zero. This means no guests are travelling so I DO
NEED a zero value and not a minimum of 1 otherwise they are buying
ingredients for non existent guests. Any way I can change it to include
this issue as well? thanks.
Shane, see you have posted but i cannot see it for some reason. happens to
me often.


  #6   Report Post  
Posted to microsoft.public.excel.misc
Ali Ali is offline
external usenet poster
 
Posts: 80
Default return a minimum value of 1, except when multiplied by an empt



"Ron Rosenfeld" wrote:

On Sun, 22 Mar 2009 02:39:00 -0700, Ali wrote:

Hi there. i have a sheet containing various stock items, and in order to
calculate the amount per item that is needed per hotel, I have a cell where a
per person per day amount (in brackets) is multiplied by a set unit for that
ingredient
A B C D E
Hotel 1 Hotel 2 Hotel 3
1) Item Unit (6.1) (1.38) (9.22)
2) Coco 0.2 1 1 2
3) Custard 0.25 2 2 2
4) Crème 0.1 1 1 1

So for example cell C2 = $C$1*B2
Because the minimum needed for just 1 guest cannot be less than one i have
changed all the formulas to be example
C2 = Max(1,Sum($C$1*B2))
this is great as it gives me a minimum of 1 for certain items that would
normally be rounded off to zero. This is great.
However, my problem is that certain items still have UNITS that need to be
determined. So example Creme, cell B4 would still be empty as the per person
per day amount is still being calculated.
I would like these cells to reflect a zero (as they are multiplying empty
cells) rather than the minimum of 1. if it is minimum 1 the stores will go
ahead and order this, thinking it is correct, rather than if it shows a zero,
the store man will realise there is a problem and double check the spread
sheets, calculate the missing unit and then order.
Hope some-one can assist.
Thanks


I don't understand some of your logic as your results do not compute from the
formula given. For example,

C2: 6.1*0.2 = 1.22 not 1
E3: 9.22*.25 = 2.305 not 2

And also the SUM function is completely unnecessary.

So it would appear you are rounding your results. Is that what you really want
to do? Or do you want to round UP to the next integer?

But, in general, to make a special case if the Unit is not filled in, you can
use a construct such as:

=IF($B3="",0,MAX(1,C$2*$B3))

If you want to round to the closest integer, then:

=IF($B3="",0,ROUND(MAX(1,C$2*$B3),0))

If you want to round up to the next integer, then:

=IF($B3="",0,CEILING(MAX(1,C$2*$B3),1))

--ron
Hi Ron, this is all fine, thanks I am using your first formula. however my problem is that should cell C2 actually be a zero, then i DO NEED a return of a zero value and not a minimum of 1. ONLY if row C ever has a zero. A zero here indictes zero guests so we want food to reflect a zeo rather than minimum 1 otherwise we are buying food for non existent guests. thanks can this be adjusted or not possible?

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default return minimum value of 1

=IF(OR($B3="",C$2=0),0,Max,(1,C$2*$B3))
--
David Biddulph

"Ali" wrote in message
...
Hi Ron
Just to make this more difficult. i am using
=IF($B3="",0,Max,(1,C$2*$B3))
which is working but now have extra hassle. It is returning a minimum of
1
except if cell B3 is empty which is great. however, I have a problem as
occassionally cell C2 is Zero. This means no guests are travelling so I
DO
NEED a zero value and not a minimum of 1 otherwise they are buying
ingredients for non existent guests. Any way I can change it to include
this issue as well? thanks.
Shane, see you have posted but i cannot see it for some reason. happens
to
me often.



  #8   Report Post  
Posted to microsoft.public.excel.misc
Ali Ali is offline
external usenet poster
 
Posts: 80
Default return minimum value of 1

Hi David, many thanks got it to work.
Cheers
Ali


"David Biddulph" wrote:

=IF(OR($B3="",C$2=0),0,Max,(1,C$2*$B3))
--
David Biddulph

"Ali" wrote in message
...
Hi Ron
Just to make this more difficult. i am using
=IF($B3="",0,Max,(1,C$2*$B3))
which is working but now have extra hassle. It is returning a minimum of
1
except if cell B3 is empty which is great. however, I have a problem as
occassionally cell C2 is Zero. This means no guests are travelling so I
DO
NEED a zero value and not a minimum of 1 otherwise they are buying
ingredients for non existent guests. Any way I can change it to include
this issue as well? thanks.
Shane, see you have posted but i cannot see it for some reason. happens
to
me often.




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
Return the minimum number in a range excluding zero Jive Excel Worksheet Functions 3 November 8th 07 01:41 PM
Select Minimum value and return the name of the supplier Mark McDonough Excel Worksheet Functions 7 June 27th 06 05:21 PM
Return minimum POSITVE value from range TheRobsterUK Excel Discussion (Misc queries) 7 September 27th 05 02:23 PM
How do I get "minimum value" in a range to NOT return zero? Blade Excel Worksheet Functions 4 February 2nd 05 02:06 AM
lookup - return minimum value Steve R Excel Worksheet Functions 7 December 30th 04 04:44 AM


All times are GMT +1. The time now is 07:49 AM.

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"