Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
TC
 
Posts: n/a
Default Looking up data in a column, then returning values of respective row

I'm trying to use Excel to create a basic rhyming dictionary. I have
one worksheet for the query and results and another worksheet holding
the word data. The data worksheet contains numerous rows of up to 30
words each that all rhyme with each other, e.g. row 1 = brick, chick,
flick; row 2 = dock, mock, clock; row 3 = career, veneer, appear (etc
etc). My idea is that when the query term is found anywhere in the data
sheet, all the words from the row it is found in are returned on the
query/results sheet. For instance if the search term is "dock", the
results in this example would be mock and clock. However I can't seem
to get LOOKUP to return the values of all cells in the relevant row, or
is that the wrong function for this?

Many thanks
TC

  #2   Report Post  
Posted to microsoft.public.excel.misc
Max
 
Posts: n/a
Default Looking up data in a column, then returning values of respective row

One play ..

A sample construct is available at:
http://www.savefile.com/files/9500795
Rhyming dictionary.xls

Assume the word data is in sheet: X,
cols A to AD, data from row1 down to row100 (say)

In sheet: X,

Insert a new col A (the word data will now be in cols B to AE)

Then put in A1: =MATCH(Query!$A$1,B1:AE1,0)
Copy A1 down to A100

In sheet: Query,

A1 will house the input for the query word

Select A2:AD2, put in the formula bar,
and array-enter the formula (Press CTRL+SHIFT+ENTER):

=IF(TRIM(A1)="","",IF(OFFSET(X!$B$1:$AE$1,MATCH(TR UE,ISNUMBER(X!$A$1:$A$100)
,0)-1,)=0,"",OFFSET(X!$B$1:$AE$1,MATCH(TRUE,ISNUMBER(X !$A$1:$A$100),0)-1,)))

A2:AD2 will return the required results,
i.e. the row which contains the word in sheet: X

Adapt to suit ..
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"TC" wrote in message
ups.com...
I'm trying to use Excel to create a basic rhyming dictionary. I have
one worksheet for the query and results and another worksheet holding
the word data. The data worksheet contains numerous rows of up to 30
words each that all rhyme with each other, e.g. row 1 = brick, chick,
flick; row 2 = dock, mock, clock; row 3 = career, veneer, appear (etc
etc). My idea is that when the query term is found anywhere in the data
sheet, all the words from the row it is found in are returned on the
query/results sheet. For instance if the search term is "dock", the
results in this example would be mock and clock. However I can't seem
to get LOOKUP to return the values of all cells in the relevant row, or
is that the wrong function for this?

Many thanks
TC



  #3   Report Post  
Posted to microsoft.public.excel.misc
Stefi
 
Posts: n/a
Default Looking up data in a column, then returning values of respective r

I think this can be solved only with a UDF! Voilá:

Function RhymeFind(rhymeto)
hitrow = 0
On Error Resume Next
hitrow = Worksheets("Sheet2").Cells.Find(What:=rhymeto, After:=[A1],
LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Row
If hitrow 0 Then
returnstr = ""
r = 1
Do While Not IsEmpty(Worksheets("Sheet2").Cells(hitrow, r))
returnstr = returnstr & Worksheets("Sheet2").Cells(hitrow, r) &
","
r = r + 1
Loop
RhymeFind = Left(returnstr, Len(returnstr) - 1)
Else
RhymeFind = "No hit!"
End If
End Function

Usage:
Enter in cell A1 the word you search rhymes to, then in B2 enter
=Rhymefind(A1)


Note, that in sheet2 the words are in separate cells!


Regards,
Stefi

TC ezt *rta:

I'm trying to use Excel to create a basic rhyming dictionary. I have
one worksheet for the query and results and another worksheet holding
the word data. The data worksheet contains numerous rows of up to 30
words each that all rhyme with each other, e.g. row 1 = brick, chick,
flick; row 2 = dock, mock, clock; row 3 = career, veneer, appear (etc
etc). My idea is that when the query term is found anywhere in the data
sheet, all the words from the row it is found in are returned on the
query/results sheet. For instance if the search term is "dock", the
results in this example would be mock and clock. However I can't seem
to get LOOKUP to return the values of all cells in the relevant row, or
is that the wrong function for this?

Many thanks
TC


  #4   Report Post  
Posted to microsoft.public.excel.misc
TC
 
Posts: n/a
Default Looking up data in a column, then returning values of respective row

Max - thank you so much! This is great and works a treat.

Regards
TC
London, UK

Max wrote:

One play ..

A sample construct is available at:
http://www.savefile.com/files/9500795
Rhyming dictionary.xls


  #5   Report Post  
Posted to microsoft.public.excel.misc
Max
 
Posts: n/a
Default Looking up data in a column, then returning values of respective row

You're welcome, TC !
Thanks for the feedback ..
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"TC" wrote in message
oups.com...
Max - thank you so much! This is great and works a treat.

Regards
TC
London, UK



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
ranking query JaimeTimbrell Excel Discussion (Misc queries) 2 February 16th 06 08:09 AM
Excel Macro to Copy & Paste [email protected] Excel Worksheet Functions 0 December 1st 05 01:56 PM
Help PLEASE! Not sure what answer is: Match? Index? Other? baz Excel Worksheet Functions 7 September 3rd 05 03:47 PM
how to put data in the column A to the next row of the column B jims Excel Discussion (Misc queries) 1 August 5th 05 12:44 AM
Can you average data in 1 column based on a range of values in another? kman24 Excel Worksheet Functions 2 November 17th 04 02:09 PM


All times are GMT +1. The time now is 01:34 AM.

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"