View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Smurfette
 
Posts: n/a
Default Index? Match? Function to sort and return value fr diff column

Hi Max,

See my solution below (hopefully this time it doesn't get lost!)

Raw data (A1:C6):
1 Apples 2
2 Bananas 0
3 Carrots 1
4 Durian 0
5 Eggs 0
6 Figs 3

Middle step (D1:D6):
0
2
0
4
5
0

Column D equation is: =IF(C1=0,$A1,0)

Final Solution (E1:G6):
1 Figs 3
2 Apples 2
3 Carrots 1
4 Bananas 0
5 Durian 0
6 Eggs 0

whe
Column E numbers the rows of data
Column F equation is:
=IF(G1=0,INDEX($B$1:$D$6,LARGE(D$1:D$6,(ROWS($A$1: $A$5)+1-$E1)),1),INDEX($B$1:$D$6,MATCH(G1,C$1:C$6,0),1))
Column G equation is: =LARGE($C$1:$C$6,$E1)

Hope this makes sense. It works because the only number that gets repeated
in my case is '0'. Not sure how to make it more general. I've absolute
referenced cells so I can easily copy and paste.

Cheers,
Debbie

"Max" wrote:

Debbie, thanks for posting back.

No prob. Glad you found a solution to your taste.

Perhaps you could also post / share
the solution for the benefit of all in the newsgroup?
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Smurfette" wrote in message
...
Thanks, Max. I've found another solution, which I wrote in a reply, but

when
it came time to posting it, I had to relog in and it got lost! In any

case,
I appreciated your help.

Cheers,
Debbie