Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default If Then

"animal" is a defined name range (eg. B2:B100)
"result" is a defined name range (eg. A2:A100)

In C2:
=IF(ISERR(SMALL(IF(animal="Cat",ROW(INDIRECT("1:"& ROWS(result)))),ROWS($1:1))),"",INDEX(result,SMALL (IF(animal="Cat",ROW(INDIRECT("1:"&ROWS(result)))) ,ROWS($1:1))))

ctrl+shift+enter, not just enter
copy down as far as needed


or you can use this formula

In C2:
=IF(COUNTIF(animal,"Cat")=ROWS($1:1),INDEX(result ,SMALL(IF(animal="Cat",ROW(animal)-MIN(ROW(animal))+1),ROWS($1:1))),"")

ctrl+shift+enter, not just enter
copy down as far as needed


"ADean" wrote:

I'm trying to find a formula that will continue to search for a row that
meets the specified IF criteria without returning the rows that do not. i.e.
I want the below reference range to provide the following based off of an IF
statement. (the actual solution needs to work for hundreds of rows)
1 Cat
2 Dog
3 Cat
4 Dog
5 Cat

Results:
1
3
5

 
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



All times are GMT +1. The time now is 05:28 AM.

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

About Us

"It's about Microsoft Excel"