View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default Function select second lowest

This might be a bit long-winded but it works without resorting to a function:-

In your 4th cell type this and drag down:-

=IF(COUNTIF(B1:D1,"0")=1,SUM(B1:D1),IF(COUNTIF(B1 :D1,"0")=2,MIN(B1:D1),IF(COUNTIF(B1:D1,"0")=3,ME DIAN(B1:D1),"Unspecified")))

I've assumed cols B,C & D for your numbers

"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!