Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22
Default Excel - Min function over 4 separate cells, but ignoring negatives

good afternoon all

I have been sent a sheet which contains lots of Min formulae which look for
lowest of 4 separate cell values, eg =MIN(M23,J23,G23,D23)

The 'challenge' I have now is to get them to ignore any negative numbers.

Can anyone help? I have tried looking around, but so far the solutions I
have seen using MIN and SMALL all seem to need the data to be in contiguous
cells...

Thanks in advance for any helpful advice

cheers

Griff
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 523
Default Excel - Min function over 4 separate cells, but ignoring negatives

=min(max(m23,0),max(j23,0),max(g23,0),max(d23,0))

would work but it's horrible.


"griff" wrote:

good afternoon all

I have been sent a sheet which contains lots of Min formulae which look for
lowest of 4 separate cell values, eg =MIN(M23,J23,G23,D23)

The 'challenge' I have now is to get them to ignore any negative numbers.

Can anyone help? I have tried looking around, but so far the solutions I
have seen using MIN and SMALL all seem to need the data to be in contiguous
cells...

Thanks in advance for any helpful advice

cheers

Griff

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22
Default Excel - Min function over 4 separate cells, but ignoring negat

thanks for the reply Sam, but this didn't work (got a zero)
in this case G23 is -0.35 if it's any help

Regards

Griff



"Sam Wilson" wrote:

=min(max(m23,0),max(j23,0),max(g23,0),max(d23,0))

would work but it's horrible.


"griff" wrote:

good afternoon all

I have been sent a sheet which contains lots of Min formulae which look for
lowest of 4 separate cell values, eg =MIN(M23,J23,G23,D23)

The 'challenge' I have now is to get them to ignore any negative numbers.

Can anyone help? I have tried looking around, but so far the solutions I
have seen using MIN and SMALL all seem to need the data to be in contiguous
cells...

Thanks in advance for any helpful advice

cheers

Griff

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Excel - Min function over 4 separate cells, but ignoring negatives

But that would return an answer of 0, rather than ignoring the negative
number.
--
David Biddulph

"Sam Wilson" wrote in message
...
=min(max(m23,0),max(j23,0),max(g23,0),max(d23,0))

would work but it's horrible.


"griff" wrote:

good afternoon all

I have been sent a sheet which contains lots of Min formulae which look
for
lowest of 4 separate cell values, eg =MIN(M23,J23,G23,D23)

The 'challenge' I have now is to get them to ignore any negative numbers.

Can anyone help? I have tried looking around, but so far the solutions I
have seen using MIN and SMALL all seem to need the data to be in
contiguous
cells...

Thanks in advance for any helpful advice

cheers

Griff



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22
Default Excel - Min function over 4 separate cells, but ignoring negatives

[EDIT]

I just realised that for some of the rows in the sheet the cells used in the
formula are sometimes blank and need to be ignored too!

While MIN automatically ignores the blanks, using the formula Sam kindly
built returns a zero for these too

"griff" wrote:

good afternoon all

I have been sent a sheet which contains lots of Min formulae which look for
lowest of 4 separate cell values, eg =MIN(M23,J23,G23,D23)

The 'challenge' I have now is to get them to ignore any negative numbers.

Can anyone help? I have tried looking around, but so far the solutions I
have seen using MIN and SMALL all seem to need the data to be in contiguous
cells...

Thanks in advance for any helpful advice

cheers

Griff



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default Excel - Min function over 4 separate cells, but ignoring negat

It is still kind of an ugly formula, but if you use some arbitrarily high
number (I used 99999 in my formula, but feel free to make the number bigger
if needed) then the following formula should work:

=MIN(IF(M230,M23,99999),IF(J230,J23,99999),IF(G2 30,G23,99999),IF(D230,D23,99999))

--
John C


"griff" wrote:

[EDIT]

I just realised that for some of the rows in the sheet the cells used in the
formula are sometimes blank and need to be ignored too!

While MIN automatically ignores the blanks, using the formula Sam kindly
built returns a zero for these too

"griff" wrote:

good afternoon all

I have been sent a sheet which contains lots of Min formulae which look for
lowest of 4 separate cell values, eg =MIN(M23,J23,G23,D23)

The 'challenge' I have now is to get them to ignore any negative numbers.

Can anyone help? I have tried looking around, but so far the solutions I
have seen using MIN and SMALL all seem to need the data to be in contiguous
cells...

Thanks in advance for any helpful advice

cheers

Griff

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Excel - Min function over 4 separate cells, but ignoringnegatives

griff wrote...
....
I have been sent a sheet which contains lots of Min formulae which
look for lowest of 4 separate cell values, eg =MIN(M23,J23,G23,D23)

The 'challenge' I have now is to get them to ignore any negative
numbers.

....

=MIN(IF(M230,M23),IF(J230,J23),IF(G230,G23),IF( D230,D23))

or, since these are every 3rd column beginning with column D, you
could use the array formula

=MIN(IF((MOD(COLUMN(D23:M23),3)=1)*(D23:M230),D23 :M23))
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 72
Default Excel - Min function over 4 separate cells, but ignoring negatives

Hi griff,

Another spin on John C's answer:

=MIN(IF(M230,M23,MAX(M23,J23,G23,D23)),IF(J230,J 23,MAX(M23,J23,G23,D23)),IF(G230,G23,MAX(M23,J23, G23,D23)),IF(D230,D23,MAX(M23,J23,G23,D23)))

This will result in a zero or negative number if all values are either zero
or negative, in which case you would want to add another condition for that
case.

Hope this helps.
Peggy

"griff" wrote:

good afternoon all

I have been sent a sheet which contains lots of Min formulae which look for
lowest of 4 separate cell values, eg =MIN(M23,J23,G23,D23)

The 'challenge' I have now is to get them to ignore any negative numbers.

Can anyone help? I have tried looking around, but so far the solutions I
have seen using MIN and SMALL all seem to need the data to be in contiguous
cells...

Thanks in advance for any helpful advice

cheers

Griff

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22
Default Excel - Min function over 4 separate cells, but ignoring negat

Thanks John - this worked fine and I don't mind if you think it's ugly!

Thanks to all the others who kindly offered their help too

cheers

Griff

"John C" wrote:

It is still kind of an ugly formula, but if you use some arbitrarily high
number (I used 99999 in my formula, but feel free to make the number bigger
if needed) then the following formula should work:

=MIN(IF(M230,M23,99999),IF(J230,J23,99999),IF(G2 30,G23,99999),IF(D230,D23,99999))

--
John C


"griff" wrote:

[EDIT]

I just realised that for some of the rows in the sheet the cells used in the
formula are sometimes blank and need to be ignored too!

While MIN automatically ignores the blanks, using the formula Sam kindly
built returns a zero for these too

"griff" wrote:

good afternoon all

I have been sent a sheet which contains lots of Min formulae which look for
lowest of 4 separate cell values, eg =MIN(M23,J23,G23,D23)

The 'challenge' I have now is to get them to ignore any negative numbers.

Can anyone help? I have tried looking around, but so far the solutions I
have seen using MIN and SMALL all seem to need the data to be in contiguous
cells...

Thanks in advance for any helpful advice

cheers

Griff

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
Ignoring #N/A in a DSUM function RobertK Excel Discussion (Misc queries) 7 May 6th 08 06:30 PM
How do I use Excel with times which are negatives? John_mitch Excel Discussion (Misc queries) 1 April 7th 06 06:59 PM
Separate first and second name in one cell into separate cells. Dwight in Georgia Excel Discussion (Misc queries) 3 January 25th 06 09:09 PM
Sort ignoring negatives and positives bangbanjo Excel Worksheet Functions 3 June 8th 05 12:21 AM
Formula to average ignoring negatives? Steve Excel Discussion (Misc queries) 16 January 1st 05 12:57 PM


All times are GMT +1. The time now is 04:29 AM.

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

About Us

"It's about Microsoft Excel"