Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Finding minum positive from the result of formula

hi,

I have four five each contain number 5, 2, 3, 4, 6 in cell A1 to E1.
Now in a new cell let's say B1 i need to select the minum positive value
from below formula

formula 1 A1-B1 = 3
formula 1 A1-C1 = 2
formula 1 A1-D1 = 1
formula 1 A1-E1 = -1

How do i develop a formula to be able to show the value of (A1-D1) which is
the minimum positive value.

--
Sincerely Yours
Haviv
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default Finding minum positive from the result of formula

I have four five each contain number 5, 2, 3, 4, 6 in cell A1 to E1.
Now in a new cell let's say B1 i need to select the minum positive value
from below formula

formula 1 A1-B1 = 3
formula 1 A1-C1 = 2
formula 1 A1-D1 = 1
formula 1 A1-E1 = -1

How do i develop a formula to be able to show the value of (A1-D1) which
is
the minimum positive value.


Probably not the most compact formula, but it does seem to do what you
asked...

=MIN(IF(A1-B1<=0,1E+300,A1-B1),IF(A1-C1<=0,1E+300,A1-C1),IF(A1-D1<=0,1E+300,A1-D1),IF(A1-E1<=0,1E+300,A1-E1))

Rick

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Finding minum positive from the result of formula

=MIN(IF($A$1-$B1:$E10,$A$1-$B1:$E1))

Entered with Ctrl+Shift+Enter

You will get {} round the formula if entered correctly
"haviv" wrote:

hi,

I have four five each contain number 5, 2, 3, 4, 6 in cell A1 to E1.
Now in a new cell let's say B1 i need to select the minum positive value
from below formula

formula 1 A1-B1 = 3
formula 1 A1-C1 = 2
formula 1 A1-D1 = 1
formula 1 A1-E1 = -1

How do i develop a formula to be able to show the value of (A1-D1) which is
the minimum positive value.

--
Sincerely Yours
Haviv

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,231
Default Finding minum positive from the result of formula

"haviv" wrote...
I have four five each contain number 5, 2, 3, 4, 6 in cell A1 to E1.
Now in a new cell let's say B1 i need to select the minum positive value
from below formula

formula 1 A1-B1 = 3
formula 1 A1-C1 = 2
formula 1 A1-D1 = 1
formula 1 A1-E1 = -1

How do i develop a formula to be able to show the value of (A1-D1) which
is the minimum positive value.


=A1-MAX(B1:E1)


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,231
Default Finding minum positive from the result of formula

"Harlan Grove" wrote...
"haviv" wrote...

....
How do i develop a formula to be able to show the value of (A1-D1) which
is the minimum positive value.


=A1-MAX(B1:E1)


Sorry, didn't read carefully enough. Either the regular formula

=A1-LARGE(B1:E1,COUNTIF(B1:E1,"="&A1))

or the array formula

=A1-MAX(IF(B1:E1<A1,B1:E1))




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Finding minum positive from the result of formula

Did you test this ...

=A1-LARGE(B1:E1,COUNTIF(B1:E1,"="&A1))

????

Answer is -1 which not what OP wanted.

It also fails on this sequence of numbers:

5 2 3 4 4

or any sequence where B1 :E1 is not A1


"Harlan Grove" wrote:

"Harlan Grove" wrote...
"haviv" wrote...

....
How do i develop a formula to be able to show the value of (A1-D1) which
is the minimum positive value.


=A1-MAX(B1:E1)


Sorry, didn't read carefully enough. Either the regular formula

=A1-LARGE(B1:E1,COUNTIF(B1:E1,"="&A1))

or the array formula

=A1-MAX(IF(B1:E1<A1,B1:E1))



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Finding minum positive from the result of formula

.. or to be correct

if B1:E1 < A1

"Toppers" wrote:

Did you test this ...

=A1-LARGE(B1:E1,COUNTIF(B1:E1,"="&A1))

????

Answer is -1 which not what OP wanted.

It also fails on this sequence of numbers:

5 2 3 4 4

or any sequence where B1 :E1 is not A1


"Harlan Grove" wrote:

"Harlan Grove" wrote...
"haviv" wrote...

....
How do i develop a formula to be able to show the value of (A1-D1) which
is the minimum positive value.

=A1-MAX(B1:E1)


Sorry, didn't read carefully enough. Either the regular formula

=A1-LARGE(B1:E1,COUNTIF(B1:E1,"="&A1))

or the array formula

=A1-MAX(IF(B1:E1<A1,B1:E1))



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,231
Default Finding minum positive from the result of formula

"Toppers" wrote...
Did you test this ...

=A1-LARGE(B1:E1,COUNTIF(B1:E1,"="&A1))

????

....

Nope. Off by one. It should be

=A1-LARGE(B1:E1,COUNTIF(A1:E1,"="&A1))


  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Finding minum positive from the result of formula

Thanks,

Rick anwers is the most suitable one while sorry topper yours is not working

--
Sincerely Yours
Haviv


"Rick Rothstein (MVP - VB)" wrote:

I have four five each contain number 5, 2, 3, 4, 6 in cell A1 to E1.
Now in a new cell let's say B1 i need to select the minum positive value
from below formula

formula 1 A1-B1 = 3
formula 1 A1-C1 = 2
formula 1 A1-D1 = 1
formula 1 A1-E1 = -1

How do i develop a formula to be able to show the value of (A1-D1) which
is
the minimum positive value.


Probably not the most compact formula, but it does seem to do what you
asked...

=MIN(IF(A1-B1<=0,1E+300,A1-B1),IF(A1-C1<=0,1E+300,A1-C1),IF(A1-D1<=0,1E+300,A1-D1),IF(A1-E1<=0,1E+300,A1-E1))

Rick


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
finding maximum, minimum in a range consists both Positive and Negative numbers Praveen Excel Worksheet Functions 3 May 4th 23 07:45 PM
Finding non contiguous positive values Nick Krill Excel Worksheet Functions 1 March 29th 07 02:09 AM
How can I add a + sign to a positive result of a calculation? PeterP9009 Excel Discussion (Misc queries) 1 June 9th 06 01:04 PM
Cell formula where result to be Positive only Freddie Excel Discussion (Misc queries) 4 February 1st 06 03:40 PM
Finding negative and positive diffrence Ashish Doshi Excel Worksheet Functions 2 May 24th 05 11:54 PM


All times are GMT +1. The time now is 05:12 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"