View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Vergel Adriano Vergel Adriano is offline
external usenet poster
 
Posts: 857
Default Function select second lowest

Somebody else might have a better idea but here's one way to do it with
formulas. Assuming the numbers are in columns B to D, in E1, put this
formula then copy down as needed.

=LARGE(B1:D1,IF(COUNTA(B1:D1)<2,1,2))

There must be at least one number in the 3 cells.. If all 3 cells are
blanks, you get #NUM!. If there's a possibility of all 3 cells being blank,
this formula will show a 0 on the fourth column to avoid getting the #NUM!.

=IF(COUNTA(B1:D1)0, LARGE(B1:D1,IF(COUNTA(B1:D1)<2,1,2)), 0)



--
Hope that helps.

Vergel Adriano


"Arne Hegefors" wrote:

Hi! I have a long list with names of banks. I also have three different
numbers (between 1 and 10) for every bank. Eg Bank A 5 7 4, Bank B 5 9 3.
Sometimes there are not three numbers for a bank but only one or two. There
are never more than three numbers though. I want to have a forth column. This
column shall give me a new number based on the other numbers. The sorting
shall work like this. If a bank only has one number then that number shall be
presented in the forth coulmn. If there are two numbers then the lowest one
shall be used. If there are three numbers then the two highest numbers shall
be chosen and if they are different the lowest one of the two highest shall
be presented in the forth coumn. I do not know if you can do this using
normal worksheet function of if a user defined function is necessary. PLease
any help very much appreciated! Thanks alot!