Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Finding Next Occurrence

I download each morning off the web information that is download as an
Excel document. Well right now, I am trying to get the "Index and
match" function to work. It works on the very first occurrence of an
item, but I cannot seem to figure out how to make it work in every
occurrence. Sometimes my first criteria will not even appear on that
day's information, and sometimes there could be as many as five
appearances. Therefore, what I am trying to do in my "Index and
Match" formula is locate the first occurrence and my first, and then
if any others appear extract them as well. Now they will always
appear, if they appear for that on line 14, of the download.

He is the formula that I am presently using:

{=INDEX('[CBHI-0129.xls]Sheet1'!$L$2:$L$100,MATCH(1,($I
$27='[CBHI-0129.xls]Sheet1'!$J$2:$J
$100)*("Data"='[CBHI-0129.xls]Sheet1'!$H$2:$H$100),0))}

Where I27 is what I am trying to match to in CBHI-0129, and this is
what could occur or could not occur, each day. In CBHI-0129 column H,
there can be the word Total or Data, all intermingled.


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Finding Next Occurrence

Example for my above post:
A B C D E F G H I J K
L M
Line 14 Data 301 $19,201.28
Line 15 Data 301
547.98
Line 16 Total 301
$19,749.26

OR

Line 14 Data 451 $24,951.65
Line 15 Total 451
$24,951.65

Hopes this example helps you in understanding what I am trying to do.



On Feb 3, 2:40*pm, caldog wrote:
I download each morning off the web information that is download as an
Excel document. *Well right now, I am trying to get the "Index and
match" function to work. *It works on the very first occurrence of an
item, but I cannot seem to figure out how to make it work in every
occurrence. *Sometimes my first criteria will not even appear on that
day's information, and sometimes there could be as many as five
appearances. *Therefore, what I am trying to do in my "Index and
Match" formula is locate the first occurrence and my first, and then
if any others appear extract them as well. *Now they will always
appear, if they appear for that on line 14, of the download.

He is the formula that I am presently using:

{=INDEX('[CBHI-0129.xls]Sheet1'!$L$2:$L$100,MATCH(1,($I
$27='[CBHI-0129.xls]Sheet1'!$J$2:$J
$100)*("Data"='[CBHI-0129.xls]Sheet1'!$H$2:$H$100),0))}

Where I27 is what I am trying to match to in CBHI-0129, and this is
what could occur or could not occur, each day. *In CBHI-0129 column H,
there can be the word Total or Data, all intermingled.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 229
Default Finding Next Occurrence

Try these array formulae
For sorted data :
=IF(ROWS($1:1)<=COUNTIF(J$2:J$10,C$1),INDEX(L$2:L$ 10,MATCH(1,(J$2:J$10=$C$1)*(H2:H10="data"),0)+ROWS ($1:1)-1),"")

For unsorted data
=IF(ROWS($1:1)<=COUNTIF(J$2:J$10,C$1),INDEX(L$2:L$ 10,SMALL(IF((J$2:J$10=C$1)*($H$2:$H$10="data"),ROW (H$2:H$10)-MIN(ROW(H$2:H$10))+1),ROWS($1:1))),"")

where C1= your I27
and change the range that fits to you. The column names are not changed.
Hope this is what you need.
With regards
Sreedhar
"caldog" wrote:

I download each morning off the web information that is download as an
Excel document. Well right now, I am trying to get the "Index and
match" function to work. It works on the very first occurrence of an
item, but I cannot seem to figure out how to make it work in every
occurrence. Sometimes my first criteria will not even appear on that
day's information, and sometimes there could be as many as five
appearances. Therefore, what I am trying to do in my "Index and
Match" formula is locate the first occurrence and my first, and then
if any others appear extract them as well. Now they will always
appear, if they appear for that on line 14, of the download.

He is the formula that I am presently using:

{=INDEX('[CBHI-0129.xls]Sheet1'!$L$2:$L$100,MATCH(1,($I
$27='[CBHI-0129.xls]Sheet1'!$J$2:$J
$100)*("Data"='[CBHI-0129.xls]Sheet1'!$H$2:$H$100),0))}

Where I27 is what I am trying to match to in CBHI-0129, and this is
what could occur or could not occur, each day. In CBHI-0129 column H,
there can be the word Total or Data, all intermingled.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Finding Next Occurrence

Thanks for the reply I am trying the formula right now and will let
you know the results. BTW I have never used or seen used the [small]
command. Just so I know for my future use what is this command used
for?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Finding Next Occurrence

Sreedhar,

It found the first occurance, but could not find the second occurance
in my example. For the second line it showed the same dollar amount
as what appears on the first line.


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Finding Next Occurrence

It is working now, except that it is finding all occurences of 301.
The two rows of "Data", $19,201.28, $547.98, and "Total" amount
$19,749.26.

What I am needing is for it to find all of the dollar amounts
associated with the word "Data" and the Code # "301". When it finds
the word "Total" that is when I need the formula to ignore the amount
in column L of my example.

Thanks again for the code.
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
vlookup on first occurrence of X after Y? jim Excel Worksheet Functions 3 January 9th 08 02:24 AM
Max value for each day, and hour of that occurrence Rich Excel Discussion (Misc queries) 2 December 5th 07 09:45 PM
Finding the most/least/average occurrence(appear) number? cinoV Excel Discussion (Misc queries) 7 March 2nd 06 06:08 AM
find last occurrence REMnLYN Excel Worksheet Functions 9 March 29th 05 10:43 AM
Max number of Occurrence Saadi Excel Worksheet Functions 5 January 28th 05 03:06 AM


All times are GMT +1. The time now is 04:26 PM.

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"