Look up highest value

motilulla

Well-known Member
Joined
Feb 13, 2008
Messages
2,422
Office Version
  1. 2010
Hello,

A............B..................C..................D..................E..................F
1--------------------------------------------------------------------------
2--------------------------------------------------------------------------
3---------22 / 183---215 / 324-----59 / 386---------------------------
4--------------------------------------------------------------------------
5--------------------------------------------------------------------------
6--------------------------------------------------------------------------
7----------W|T|A-----W|T|B---------W|T|C----------------------------
8-------------------------------------------------------------------------
9------------------------------------------------------------------------B


I am looking some Formula or VBA which can look in the row 3, column B, C & D Left values before "/" which are 22, 215, & 59 look the highest among 3 values and find in the same column in row 7 most right word and place in the cell F9

For example C3 has highest value 215 so far looking in same column C in the row C7 is the most right word is "B" place in the cell F9.

Thank you all
Excel 2000
Regards,
Moti
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
In cell F9, enter the formula:

=RIGHT(INDEX(B7:D7,0,MATCH(MAX(VALUE(LEFT(B3:D3,SEARCH(" /",B3:D3)-1))),VALUE(LEFT(B3:D3,SEARCH(" /",B3:D3)-1)),0)),1)

and press CTRL + SHIFT + ENTER to commit it as an array formula. This will return the result B.
 
Upvote 0
If there is a tie for highest value this will return the first match. that is 77/183 60/136 77/183 will return the value from column B since that is the first match found.


Excel 2010
ABCDEF
1
2
322/183215/32459/286
4
5
6
7W|T|AW|T|BW|T|C
8
9B
Sheet7
Cell Formulas
RangeFormula
F9{=TRIM(RIGHT(SUBSTITUTE(INDEX(B7:D7,MATCH(MAX(TRIM(LEFT(B3:D3,SEARCH("/",B3:D3)-1))+0),TRIM(LEFT(B3:D3,SEARCH("/",B3:D3)-1))+0,0)),"|",REPT(" ",200)),200))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
What it does (follow along with Evaluate Formula to see it in action, words in CAPS are the formulas used in plain text description):

Using an array formula, it parses the characters to the LEFT of the result of a SEARCH of a space and a slash [" /"] - {"22,"215","59"}
Converts those to a numeric VALUE (stored as text/string), then looks for the MAX - 215.
Knowing the largest, MATCH the largest to its position within the array - 2nd position.
INDEX the row you want info from and pull the value from the 2nd position - "W|T|B".
Parse the single RIGHTmost character from the string - "B".
 
Upvote 0
In cell F9, enter the formula:

=RIGHT(INDEX(B7:D7,0,MATCH(MAX(VALUE(LEFT(B3:D3,SEARCH(" /",B3:D3)-1))),VALUE(LEFT(B3:D3,SEARCH(" /",B3:D3)-1)),0)),1)

and press CTRL + SHIFT + ENTER to commit it as an array formula. This will return the result B.
Hello gmhumphr,
how are you doing?

In the row 7, in the third alphabet Instead of a letter if change it to a number from 1 to 9 I get the perfect result but when I convert it into value I find one space before that number. How can I eliminate this space?

Please, can you modify the formula to not get this space.

Thank you for your time.

Kind Regards,
Moti
 
Upvote 0
Hello gmhumphr,
how are you doing?

In the row 7, in the third alphabet Instead of a letter if change it to a number from 1 to 9 I get the perfect result but when I convert it into value I find one space before that number. How can I eliminate this space?

Please, can you modify the formula to not get this space.

Thank you for your time.

Kind Regards,
Moti

Moti - Please clarify the issue and give me the exact contents of the cell in row 7 that is matched so I can understand. What does the formula give you and what do you want it to give you instead.
Currently the RIGHT formula takes the single, last character of the matched cell. Unless there was a trailing space, I would expect that the formula returns an apparently blank cell (really, a space character) and not a number with a space in front of it.
 
Upvote 0
Moti - Please clarify the issue and give me the exact contents of the cell in row 7 that is matched so I can understand. What does the formula give you and what do you want it to give you instead.
Currently the RIGHT formula takes the single, last character of the matched cell. Unless there was a trailing space, I would expect that the formula returns an apparently blank cell (really, a space character) and not a number with a space in front of it.
Hello gmhumphr,

It’s a strange situation now it is working perfect there is no space in before numbers.

Sorry for the inconvenience.

Thank you for the response

Kind Regards,
Moti
 
Upvote 0

Forum statistics

Threads
1,223,705
Messages
6,173,989
Members
452,541
Latest member
haasro02

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top