Finding the Relative Position of an Item in a List or Table - KING OF EXCEL

KINGEXCEL.INFO ( KING OF EXCEL ) Welcome KINGEXCEL.INFO - Nothing Is Unable ... About Excel Tricks, Learning VBA Programming, Dedicated Software, Accounting, Living Skills ...

## Tuesday, December 31, 2019

Finding the Relative Position of an Item in a List or Table
You’ll sometimes need to know the relative position, such as the relative row in a list or table of an item. This is usually different than the item’s actual row on the Excel spreadsheet grid.
For example, suppose you have a table of data such as that pictured below, where you want to know the row position in that table of the maximum annual expense item. As you see, the expense item is Payroll because its annual number is the largest in range F5:F15. True, the maximum number in the list resides on row 12 of the spreadsheet, but what you need to know is that maximum number’s position, relative to the range of interest.
In cell H2, the formula `=MATCH(MAX(F5:F15),F5:F15,0)` returns 8 because the 8th row (position) in the range of F5:F15 holds the maximum number.

## Finding the Lowest Positive Number

Here’s how to return the lowest positive number in a list that has positive and negative numbers.
In the pictured example, the number 1 is returned in cell L3 because it happens to be the lowest number above par (in column C) in the list of this year’s Masters Golf Tournament final scores.
The array formula in cell L3 is `=MIN(IF(C4:C50>0,C4:C50))`.
Recall, an array formula is applied to a cell by simultaneously pressing the `Ctrl+Shift+Enter` keys, not just `Enter`. The curly braces are not typed in by you; Excel places them automatically when the array formula is properly applied.
If you are unfamiliar with array formulas, see my video and explanation of arrays here.

## Finding the Number Farthest From Zero

Sometimes you’ll need to find a number in a list that is farthest from zero, where some numbers might be positive and others might be negative.
1. You will need more than a simple `MIN` or `MAX` function.
2. You will want to decide how to display the number, either as…
(a) …its raw actual appearance in the list, be it positive or negative, or
(b) …its absolute representation as a positive-looking number even if that raw number is negative.
The first picture shows the raw actual number of -22 in cell E3, with this array formula:
`=IF(AND(MIN(B4:B15)<0,MIN(ABS(B4:B15)))>=MAX(B4:B15),MIN(B4:B15),MAX(B4:B15))`
EDIT ON JUNE 21, 2013:
See Jeremy’s comment below, in which he found my formula in cell E3 to be in error.
Jeremy’s formula, which is correct and which you should use instead of mine, is this array:
`=IF(ABS(MIN(B4:B15))>=MAX(B4:B15),MIN(B4:B15),MAX(B4:B15))`
Thank you Jeremy!
– Tom
In the next picture, the absolute number 22 is returned in cell H3 with this array formula:
`=MAX(ABS(B4:B15))`
Note, these formulas are both array formulas. Recall, an array formula is applied to a cell by simultaneously pressing the `Ctrl+Shift+Enter` keys, not just `Enter`. The curly braces are not typed in by you; Excel places them automatically when the array formula is properly applied.
#evba #etipfree #kingexcel
ðŸ“¤You download App EVBA.info installed directly on the latest phone here : https://www.evba.info/p/app-evbainfo-setting-for-your-phone.html?m=1
#evba #etipfree #kingexcel