#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Row() Question

I am trying to understand this formula:

=INDEX(B5:C19,SMALL(IF(B5:B19=B21,ROW(B5:B19)-ROW(B5)+1,ROW(B19)+1),C21),2)

but am confused with the portion on

IF(B5:B19=B21,ROW(B5:B19)-ROW(B5)+1,ROW(B19)+1)


Can someone help to explain it please? Thank you very much.






  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Row() Question

Quite simply, it is comparing each cell in B5:B19 against the value in B21.
Where a match is found it outputs that row index number, otherwise it
outputs 20 ( a value greater than any row number).

SMALL is then used against that array of values to get the nth smallest row,
n being the value in C21. This nth smallest row index is used to INDEX into
range B5:B19 to get a value.

ROW(B5:B19)-ROW(B5)+1 is used to get the row indexes, rather than the rows,
(1,2,3 as against 5,6,7), as it is then used to INDEX into a range starting
at B5, not B1,

But it all seems pointless to me, it is getting the nth smallest row index
in a range, a range determined by a value, and then indexing into the same
range. In other words, the answer can only be the value in B21, or an error.

---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"mldancing" wrote in message
...
I am trying to understand this formula:

=INDEX(B5:C19,SMALL(IF(B5:B19=B21,ROW(B5:B19)-ROW(B5)+1,ROW(B19)+1),C21),2)

but am confused with the portion on

IF(B5:B19=B21,ROW(B5:B19)-ROW(B5)+1,ROW(B19)+1)


Can someone help to explain it please? Thank you very much.








  #3   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Row() Question

OT here ... You should always post a closure to discussions in your threads.
Eg: Sumproduct Question
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default Row() Question

Thanks for the tips, Bob!

I will go through it and try to digest the information.


"Bob Phillips" wrote:

Quite simply, it is comparing each cell in B5:B19 against the value in B21.
Where a match is found it outputs that row index number, otherwise it
outputs 20 ( a value greater than any row number).

SMALL is then used against that array of values to get the nth smallest row,
n being the value in C21. This nth smallest row index is used to INDEX into
range B5:B19 to get a value.

ROW(B5:B19)-ROW(B5)+1 is used to get the row indexes, rather than the rows,
(1,2,3 as against 5,6,7), as it is then used to INDEX into a range starting
at B5, not B1,

But it all seems pointless to me, it is getting the nth smallest row index
in a range, a range determined by a value, and then indexing into the same
range. In other words, the answer can only be the value in B21, or an error.

---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"mldancing" wrote in message
...
I am trying to understand this formula:

=INDEX(B5:C19,SMALL(IF(B5:B19=B21,ROW(B5:B19)-ROW(B5)+1,ROW(B19)+1),C21),2)

but am confused with the portion on

IF(B5:B19=B21,ROW(B5:B19)-ROW(B5)+1,ROW(B19)+1)


Can someone help to explain it please? Thank you very much.









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
If, then question Cacoe Excel Worksheet Functions 3 June 30th 06 05:06 PM
Not sure how to do this, not even sure how to ask the question clearly... rich Excel Worksheet Functions 4 May 7th 06 01:30 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
The question is an excel question that I need to figure out howto do in excel. Terry Excel Worksheet Functions 3 January 23rd 06 06:22 PM
question [email protected] Excel Worksheet Functions 2 September 23rd 05 11:23 AM


All times are GMT +1. The time now is 03:27 AM.

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

About Us

"It's about Microsoft Excel"