In the range A11:A21 I have formulae that either returns 'something' or says "not used". Depending on the data in the cells referenced by these formula the final one that does NOT return 'something' could be anywhere from A11 to A21. For example, cells A11:A14 could each be populated with 'something', then cells A15:A20 could be "not used" and then cell A21 be 'something'. Or A11:12 could be something then A13:A19 "not used", A20 'something' and A21 once again "not used". I'm trying to figure out the most elegant way of getting the row number of the last 'something'.
At the moment I'm using the range J11:J21 to display the row number if A11:A21 is 'something' and then above that range, in J10, I'm getting the MAX of the range (J11:J21). That does the job but I can't help feeling there's a neater way of doing this. Could it be done in a single cell, perhaps with some sort of array formula?
Ken
finding a particular row number
-
- Panoramic Lounger
- Posts: 8175
- Joined: 25 Jan 2010, 09:09
- Location: retirement
-
- Administrator
- Posts: 78465
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: finding a particular row number
As an array formula, confirmed with Ctrl+Shift+Enter:
=MAX((A11:A21<>"not used")*ROW(A11:A21))
Remark: if ALL cells in A11:A21 contain "not used", this formula returns 0.
=MAX((A11:A21<>"not used")*ROW(A11:A21))
Remark: if ALL cells in A11:A21 contain "not used", this formula returns 0.
Best wishes,
Hans
Hans
-
- Panoramic Lounger
- Posts: 8175
- Joined: 25 Jan 2010, 09:09
- Location: retirement
Re: finding a particular row number
Thank you Hans That deserves aHansV wrote:As an array formula...
Ken
-
- Administrator
- Posts: 78465
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: finding a particular row number
Best wishes,
Hans
Hans