Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,670
Default How to solve the following code?

Referring to Excel General Question 12/13/2006 6:43 AM PST
In following cells

[A1] 1 [B1] 22 [C1] 2
[A2] 2 [B2] 25 [C2] 1
[A3] 3 [B3] 22 [C3] 1, I would like it equals to 3

[C1]=OFFSET($A$1,MATCH(LARGE(B:B,$A1),B:B,0)-1,0)
[C2]=OFFSET($A$1,MATCH(LARGE(B:B,$A2),B:B,0)-1,0)
[C3]=OFFSET($A$1,MATCH(LARGE(B:B,$A3),B:B,0)-1,0)

When the MATCH function is being used, the OFFSET will always locate the
first value in cell A1, and skip the second value in cell A3, since both
values in B colume are equal to 22. Does anyone know how to modify the code
in C3? so the cell C3 can display the second value in cell A3.
Thank you for any suggestion
Eric

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default How to solve the following code?

One way is to use a helper col to break the ties,
then point the OFFSET at this col, eg:

In D1:
=IF(B1="","",B1-ROW()/10^10)

In C1:
=OFFSET($A$1,MATCH(LARGE(D:D,$A1),D:D,0)-1,0)

Select C1:D1, copy down as far as required
Col C will return the required results
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Eric" wrote:
Referring to Excel General Question 12/13/2006 6:43 AM PST
In following cells

[A1] 1 [B1] 22 [C1] 2
[A2] 2 [B2] 25 [C2] 1
[A3] 3 [B3] 22 [C3] 1, I would like it equals to 3

[C1]=OFFSET($A$1,MATCH(LARGE(B:B,$A1),B:B,0)-1,0)
[C2]=OFFSET($A$1,MATCH(LARGE(B:B,$A2),B:B,0)-1,0)
[C3]=OFFSET($A$1,MATCH(LARGE(B:B,$A3),B:B,0)-1,0)

When the MATCH function is being used, the OFFSET will always locate the
first value in cell A1, and skip the second value in cell A3, since both
values in B colume are equal to 22. Does anyone know how to modify the code
in C3? so the cell C3 can display the second value in cell A3.
Thank you for any suggestion
Eric

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,670
Default How to solve the following code?

Thank you very much for suggestion
Eric
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default How to solve the following code?

You're welcome, Eric !
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Eric" wrote in message
...
Thank you very much for suggestion
Eric



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
How to solve the following code? Eric Excel Discussion (Misc queries) 1 December 14th 06 01:15 PM
Text formatting Kace Excel Worksheet Functions 1 September 18th 06 08:28 PM
code not unique find latest date Barbara Wiseman Excel Discussion (Misc queries) 3 December 11th 05 08:50 AM
VLOOKUP for Zip Code Ranges JerseyJR Excel Worksheet Functions 2 September 6th 05 06:37 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM


All times are GMT +1. The time now is 11:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"