Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default search an array in reverse (bottom to top) order

I am using an INDEX & MATCH formula to search for the occurrence of a
specific text string within an array. I used the following formula:
=INDEX($A$1:$A$20,MATCH("*Specific Text String*",$B$1:$B$20,0)) But this
formula works its way down the array giving me the first occurrence of the
"Specific Text". What I want is the last occurrence (or the one closest to
the end of the array). Please help.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default search an array in reverse (bottom to top) order

See:

http://groups.google.com/group/micro...f31ed02fc7b157
--
Gary''s Student - gsnu200761


"Trainer_00" wrote:

I am using an INDEX & MATCH formula to search for the occurrence of a
specific text string within an array. I used the following formula:
=INDEX($A$1:$A$20,MATCH("*Specific Text String*",$B$1:$B$20,0)) But this
formula works its way down the array giving me the first occurrence of the
"Specific Text". What I want is the last occurrence (or the one closest to
the end of the array). Please help.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default search an array in reverse (bottom to top) order

I appreciate the quick response, and I looked at the link you provided. I
attempted to use the formula on the link, but it did not work. I have a
strange feeling that I'm just missing a small part for my original formula
that I just can't figure out. Is there any way I can reverse the order of
the array within the formula? Thank you though, I really do appreciate the
effort.

"Gary''s Student" wrote:

See:

http://groups.google.com/group/micro...f31ed02fc7b157
--
Gary''s Student - gsnu200761


"Trainer_00" wrote:

I am using an INDEX & MATCH formula to search for the occurrence of a
specific text string within an array. I used the following formula:
=INDEX($A$1:$A$20,MATCH("*Specific Text String*",$B$1:$B$20,0)) But this
formula works its way down the array giving me the first occurrence of the
"Specific Text". What I want is the last occurrence (or the one closest to
the end of the array). Please help.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default search an array in reverse (bottom to top) order

Try this:

=LOOKUP(2,1/(B1:B20="text_string"),A1:A20)

--
Biff
Microsoft Excel MVP


"Trainer_00" wrote in message
...
I am using an INDEX & MATCH formula to search for the occurrence of a
specific text string within an array. I used the following formula:
=INDEX($A$1:$A$20,MATCH("*Specific Text String*",$B$1:$B$20,0)) But this
formula works its way down the array giving me the first occurrence of the
"Specific Text". What I want is the last occurrence (or the one closest
to
the end of the array). Please help.



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default search an array in reverse (bottom to top) order

Thank you, that formula worked very well except for the instances where the
text string was actually a sub-text string within a larger string in a single
cell. Any suggestions of how I can use your formula and match a sub-text
string?

"T. Valko" wrote:

Try this:

=LOOKUP(2,1/(B1:B20="text_string"),A1:A20)

--
Biff
Microsoft Excel MVP


"Trainer_00" wrote in message
...
I am using an INDEX & MATCH formula to search for the occurrence of a
specific text string within an array. I used the following formula:
=INDEX($A$1:$A$20,MATCH("*Specific Text String*",$B$1:$B$20,0)) But this
formula works its way down the array giving me the first occurrence of the
"Specific Text". What I want is the last occurrence (or the one closest
to
the end of the array). Please help.






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default search an array in reverse (bottom to top) order

=LOOKUP(2,1/SEARCH("sub_string",B1:B20),A1:A20)

Better to use a cell reference:

D1 = sub_string

=LOOKUP(2,1/SEARCH(D1,B1:B20),A1:A20)

--
Biff
Microsoft Excel MVP


"Trainer_00" wrote in message
...
Thank you, that formula worked very well except for the instances where
the
text string was actually a sub-text string within a larger string in a
single
cell. Any suggestions of how I can use your formula and match a sub-text
string?

"T. Valko" wrote:

Try this:

=LOOKUP(2,1/(B1:B20="text_string"),A1:A20)

--
Biff
Microsoft Excel MVP


"Trainer_00" wrote in message
...
I am using an INDEX & MATCH formula to search for the occurrence of a
specific text string within an array. I used the following formula:
=INDEX($A$1:$A$20,MATCH("*Specific Text String*",$B$1:$B$20,0)) But
this
formula works its way down the array giving me the first occurrence of
the
"Specific Text". What I want is the last occurrence (or the one
closest
to
the end of the array). Please help.






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
How do I reverse name order from Last, First to First Last in Exc Annie Lord Excel Discussion (Misc queries) 4 April 22nd 23 02:10 AM
reverse order of numbers Dave F[_2_] Excel Discussion (Misc queries) 5 September 16th 07 01:41 PM
reverse order Lamb Chop Excel Discussion (Misc queries) 2 June 20th 06 03:37 PM
Reverse Data from bottom to top Joman Excel Discussion (Misc queries) 2 August 16th 05 03:30 PM
Sorting in reverse (from right-to-left and from top-to-bottom) retman Excel Discussion (Misc queries) 6 April 1st 05 09:29 AM


All times are GMT +1. The time now is 07:23 PM.

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"