Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Member
 
Posts: 89
Default Returning Cell Value if Matches Another cell

I know I've posted this before, but I can't seem to get it to work. I've tried VLOOKUP, MATCH, LOOKUP, and such with inconsistent results. Here's what I'm trying to do:

I have Percentage Values in Column A and Numbers corresponding to them in Column B - I want to return the three largest values from Column A in Column D with the corresponding Numbers from Column B in Column E. Such as:

Column A Column B Column C Column D Column E
2.3565 1 BLANK 2.66354 5
2.4569 2 BLANK 2.5369 3
2.5369 3 BLANK 2.4569 2
2.11547 4 BLANK
2.66354 5 BLANK

And if there happen to be two or more percentage values with the same value, to return them as well individually.
Any/all assistance would be greatly appreciated.

Thank you in advance for your help,
Frank
  #2   Report Post  
Junior Member
 
Posts: 2
Cool

Is there any reason you can't just sort the sheet descending by column A?

If you can't, this would be easiest in VB.


However if you need to do this with formulas, for column D you could potentially use MAX combined with other formulas. D1 is an easy win (MAX). D2 you would need to find the cell reference in column A that matches D1, then get a MAX for above and below that cell. Same concept for D3, just lots more matching and maxing.

Then in column E use something like this:

=INDEX(B:B,MATCH(D1,A:A))


Hope that helps.
  #3   Report Post  
Member
 
Posts: 89
Default

Thank you for the reply. Can you walk me through the steps with examples, please? I am having a hard time seeing how this is done.
Quote:
Originally Posted by thedunedan View Post
Is there any reason you can't just sort the sheet descending by column A?

If you can't, this would be easiest in VB.


However if you need to do this with formulas, for column D you could potentially use MAX combined with other formulas. D1 is an easy win (MAX). D2 you would need to find the cell reference in column A that matches D1, then get a MAX for above and below that cell. Same concept for D3, just lots more matching and maxing.

Then in column E use something like this:

=INDEX(B:B,MATCH(D1,A:A))


Hope that helps.
  #4   Report Post  
Member
 
Posts: 89
Default

By the way, I don't how to do this in VB. If you can show me the steps, I can follow.
Quote:
Originally Posted by frankjh19701 View Post
Thank you for the reply. Can you walk me through the steps with examples, please? I am having a hard time seeing how this is done.
  #5   Report Post  
Senior Member
 
Location: Belo Horizonte, Brazil
Posts: 170
Thumbs up

Quote:
Originally Posted by frankjh19701 View Post
By the way, I don't how to do this in VB. If you can show me the steps, I can follow.
--------------------------------------------------------------------------

Dear Frankjh19701, Good Morning.

Your example:

____A________B___C______D_____________E
1___2.35650___1___blank__=FORMULA 1___=FORMULA 2
2___2.45690___2___blank__=FORMULA 1___=FORMULA 2
3___2.53690___3___blank__=FORMULA 1___=FORMULA 2
4___2.11547___4
5___2.66354___5


DO THIS:

FORMULA 1
D1 -- =LARGE(A:A,1)
D2 -- =LARGE(A:A,2)
D3 -- =LARGE(A:A,3)

FORMULA 2
E1 -- =INDEX(B:B,MATCH(D1,A:A,0))
E2 -- =INDEX(B:B,MATCH(D2,A:A,0))
E3 -- =INDEX(B:B,MATCH(D3,A:A,0))

Try this one.

Please, tell me if it worked for you.
Feel free to ask anything about it.

Have a nice day.
__________________
I hope it can help you.

Best regards,
Marcilio Lobão
---------------------------
Belo Horizonte, Brazil


  #6   Report Post  
Member
 
Posts: 89
Default

Yes, that works. However, what do I do if I have duplicates? How can I show them all? I have two for Number one (Largest Value) but it's only showing the same number twice - the first one in the list not the second one.

Quote:
Originally Posted by Mazzaropi View Post
--------------------------------------------------------------------------

Dear Frankjh19701, Good Morning.

Your example:

____A________B___C______D_____________E
1___2.35650___1___blank__=FORMULA 1___=FORMULA 2
2___2.45690___2___blank__=FORMULA 1___=FORMULA 2
3___2.53690___3___blank__=FORMULA 1___=FORMULA 2
4___2.11547___4
5___2.66354___5


DO THIS:

FORMULA 1
D1 -- =LARGE(A:A,1)
D2 -- =LARGE(A:A,2)
D3 -- =LARGE(A:A,3)

FORMULA 2
E1 -- =INDEX(B:B,MATCH(D1,A:A,0))
E2 -- =INDEX(B:B,MATCH(D2,A:A,0))
E3 -- =INDEX(B:B,MATCH(D3,A:A,0))

Try this one.

Please, tell me if it worked for you.
Feel free to ask anything about it.

Have a nice day.
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
Maddening Dilemma - Compare each cell within column a to each cell in column b and find unique matches [email protected] Excel Worksheet Functions 66 May 1st 23 03:44 AM
Stop cell showing zero when returning a blank cell Sapper Excel Discussion (Misc queries) 2 April 26th 09 11:24 PM
Returning Multiple Matches Adam Hodge Excel Worksheet Functions 4 November 13th 08 04:09 PM
Returning matches from mutiple rows Sunshine Excel Worksheet Functions 4 March 30th 08 10:10 PM
Returning Cell Contents of One Cell Based On Another Cell DallasLDY Excel Worksheet Functions 5 January 31st 07 11:00 PM


All times are GMT +1. The time now is 10:56 PM.

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"