Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Detect strings in a range

I have a duty rota consisting of a range of cells containing names. The first
column of the range contains dates. The column headings are the duties.
I want to present this information in a different way for the benefit of
those on duty. I want to construct a new table, ideally on a different
worksheet, containing a list of names down column 1, the duties across the
column headings in row 1, and dates in the rows. I want the people to be able
to look at this table to find out quickly which dates they are responsible
for.
I began by trying to use VLOOKUP until I foiund that this requires an
alphabetically-sorted table.
I can explain the function like this:
I want to match a string within a range of cells.
If true, I want to print the contents of the row in the date column.
If false, I want a blank cell.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Detect strings in a range

You can use vlookup

however use vlookup(val,range,col,False)

the false looks for an exact match and does not require an ordered list

Lance

"Rich57" wrote:

I have a duty rota consisting of a range of cells containing names. The first
column of the range contains dates. The column headings are the duties.
I want to present this information in a different way for the benefit of
those on duty. I want to construct a new table, ideally on a different
worksheet, containing a list of names down column 1, the duties across the
column headings in row 1, and dates in the rows. I want the people to be able
to look at this table to find out quickly which dates they are responsible
for.
I began by trying to use VLOOKUP until I foiund that this requires an
alphabetically-sorted table.
I can explain the function like this:
I want to match a string within a range of cells.
If true, I want to print the contents of the row in the date column.
If false, I want a blank cell.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Detect strings in a range

A VLOOKUP table does not have to be sorted alphabetically if you use the fourth
argument of FALSE which will return #N/A if string not found

=VLOOKUP(cellref,TableRange,tablecol,FALSE)

Assume your table is A1:B10 and you enter the string in C1

in D1 enter =VLOOKUP(C1,$A$1:$B$10,2,FALSE)

To return a blank if false use an error trap.

=IF(ISNA(VLOOKUP(C1,$A$1:$B$10,2,FALSE)),"",VLOOKU P(C1,$A$1:$B$10,2,FALSE))

On another sheet

=IF(ISNA(VLOOKUP(C1,Sheet1!$A$1:$B$10,2,FALSE)),"" ,VLOOKUP(C1,Sheet1!$A$1:$B$10,2,FALSE))

Less typing if you designate a named range for the Sheet1!$A$1:$B$10

Select that range on Sheet1 and InsertNameDefine

Give it a name like MyTable

Then formula becomes........

=IF(ISNA(VLOOKUP(C1,MyTable,2,FALSE)),"",VLOOKUP(C 1,MyTable,2,FALSE))


Gord Dibben MS Excel MVP

On Sun, 30 Dec 2007 14:52:01 -0800, Rich57
wrote:

I have a duty rota consisting of a range of cells containing names. The first
column of the range contains dates. The column headings are the duties.
I want to present this information in a different way for the benefit of
those on duty. I want to construct a new table, ideally on a different
worksheet, containing a list of names down column 1, the duties across the
column headings in row 1, and dates in the rows. I want the people to be able
to look at this table to find out quickly which dates they are responsible
for.
I began by trying to use VLOOKUP until I foiund that this requires an
alphabetically-sorted table.
I can explain the function like this:
I want to match a string within a range of cells.
If true, I want to print the contents of the row in the date column.
If false, I want a blank cell.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Detect strings in a range

Thanks for that, Gord, and for the FALSE reminder, LanceB.

I just have one issue: the 3rd argument in VLOOKUP is a column number. I
have the formula on a separate worksheet (called Dates), and the result takes
the data from col 1 on the Dates sheet instead of where the cell range is.
This argument is a number so presumably I can't use a cell reference here?
This gives a #VALUE! error. How do I get round this?

Richard

"Gord Dibben" wrote:

=IF(ISNA(VLOOKUP(C1,MyTable,2,FALSE)),"",VLOOKUP(C 1,MyTable,2,FALSE))


Gord Dibben MS Excel MVP

On Sun, 30 Dec 2007 14:52:01 -0800, Rich57
wrote:

I have a duty rota consisting of a range of cells containing names. The first
column of the range contains dates. The column headings are the duties.
I want to present this information in a different way for the benefit of
those on duty. I want to construct a new table, ideally on a different
worksheet, containing a list of names down column 1, the duties across the
column headings in row 1, and dates in the rows. I want the people to be able
to look at this table to find out quickly which dates they are responsible
for.
I began by trying to use VLOOKUP until I foiund that this requires an
alphabetically-sorted table.
I can explain the function like this:
I want to match a string within a range of cells.
If true, I want to print the contents of the row in the date column.
If false, I want a blank cell.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Detect strings in a range

On your source sheet you would need at least a 2 column lookup table.

i.e. A1:B10

Your lookup cell(C1) on Dates sheet is the number to look up in Column A of
source sheet and return the value of corresponding cell in column B.


Gord

On Mon, 31 Dec 2007 03:14:00 -0800, Rich57
wrote:

Thanks for that, Gord, and for the FALSE reminder, LanceB.

I just have one issue: the 3rd argument in VLOOKUP is a column number. I
have the formula on a separate worksheet (called Dates), and the result takes
the data from col 1 on the Dates sheet instead of where the cell range is.
This argument is a number so presumably I can't use a cell reference here?
This gives a #VALUE! error. How do I get round this?

Richard

"Gord Dibben" wrote:

=IF(ISNA(VLOOKUP(C1,MyTable,2,FALSE)),"",VLOOKUP(C 1,MyTable,2,FALSE))


Gord Dibben MS Excel MVP

On Sun, 30 Dec 2007 14:52:01 -0800, Rich57
wrote:

I have a duty rota consisting of a range of cells containing names. The first
column of the range contains dates. The column headings are the duties.
I want to present this information in a different way for the benefit of
those on duty. I want to construct a new table, ideally on a different
worksheet, containing a list of names down column 1, the duties across the
column headings in row 1, and dates in the rows. I want the people to be able
to look at this table to find out quickly which dates they are responsible
for.
I began by trying to use VLOOKUP until I foiund that this requires an
alphabetically-sorted table.
I can explain the function like this:
I want to match a string within a range of cells.
If true, I want to print the contents of the row in the date column.
If false, I want a blank cell.




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
Detect non-blank range Connie Excel Discussion (Misc queries) 2 October 16th 06 08:36 PM
strings in a range Peter Morris Excel Worksheet Functions 4 September 5th 06 01:00 AM
How to find number of pairs of strings from list of strings? greg_overholt Excel Worksheet Functions 5 January 27th 06 10:42 PM
how to detect 5th character? nastech Excel Discussion (Misc queries) 4 October 31st 05 11:31 AM
How can I count strings within strings Paul W Excel Worksheet Functions 4 June 14th 05 12:39 PM


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