[Solved] How do I get the row number?

Discuss the spreadsheet application

[Solved] How do I get the row number?

Postby Ilan » Mon May 19, 2008 3:01 pm

Suppose I have a list of expenses and I want to get the text defining the maximum expense.
For the sake of argument, the text is in column B and the expense in column D.
To get the maximum I would use =MAX(D1:D100), but I want to know what row that is.
If I knew the row I could put in column G1 =B10, where B10 would be some sort of variable.

This should be a simple question to someone with more experience than myself.

Thanks,
Ilan
Last edited by Ilan on Mon May 19, 2008 4:01 pm, edited 1 time in total.
OOo 3.0.X on Ubuntu 8.x + Windows XP
Ilan
 
Posts: 61
Joined: Tue Apr 15, 2008 9:44 am
Location: Haifa, Israel

Re: How do I get the row number?

Postby Villeroy » Mon May 19, 2008 3:13 pm

Get the text in B from the row where max(D) is found:
=INDEX($B$1:$B$100;MATCH(MAX($D$1:$D$100);$D$1:$D$100;0))

MATCH returns an integer number>0 indicating the matched position (or #NA in case of no match).
INDEX returns a value out of a range, specified by the row index and (optional) column index.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 28544
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany


Return to Calc

Who is online

Users browsing this forum: minikin11 and 25 guests