Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 390
Default function to return position in a list

I'm trying to find a function(or formula) that will return the relative
position of an item selected in a list of items. For example: from a
drop-down list, if you choose the 8th item in the list, the function returns
the value "8"; the 3rd item would return the value "3", and so on.

Any help would be greatly appreciated!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default function to return position in a list

See if this example helps:

A1:A10 contains this list:
Alpha
Bravo
Charlie
Delta
Echo
Foxtrot
Golf
Hotel
India
Juliet

B1 contains a Data Validation based on that list.

This formula returns the postition of the
selected B1 item in the source list:
C1: =IF(COUNTIF(A1:A10,B1),MATCH(B1,A1:A10,0),"")

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Bill" wrote in message
...
I'm trying to find a function(or formula) that will return the relative
position of an item selected in a list of items. For example: from a
drop-down list, if you choose the 8th item in the list, the function
returns
the value "8"; the 3rd item would return the value "3", and so on.

Any help would be greatly appreciated!




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default function to return position in a list

If you want to use a combo box from the Forms toolbar it will return the
relative number of the selected item.

Or, if the source for your data validation list is a range of cells, say,
X1:X10, and the drop down is in cell A1:

Then you can try something like this:

=IF(A1="","",MATCH(A1,X1:X10,0))


--
Biff
Microsoft Excel MVP


"Bill" wrote in message
...
I'm trying to find a function(or formula) that will return the relative
position of an item selected in a list of items. For example: from a
drop-down list, if you choose the 8th item in the list, the function
returns
the value "8"; the 3rd item would return the value "3", and so on.

Any help would be greatly appreciated!



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
Return position of 2nd, 3rd, ect occurrence of a character in a st jheby Excel Discussion (Misc queries) 5 April 21st 23 09:06 AM
Return cursor to previous position Kevryl Excel Discussion (Misc queries) 4 April 19th 07 11:36 AM
Return position for each matching value in entire workbook? Squidman Excel Worksheet Functions 1 September 15th 06 11:36 PM
How do I make the true return a drop down list in the IF function? Brian Excel Worksheet Functions 5 April 13th 06 09:40 PM
Formula to return cell position AJPendragon Excel Worksheet Functions 1 February 6th 06 09:34 PM


All times are GMT +1. The time now is 07:22 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"