Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default find and return adjacent value (redux)!

I posted this earlier, but missed a key element in the example.

How would I do the following using a formula:

Find the row that contains value X, then in that row find the cell that
contains value Y, then return the value to the immediate right?

Example:
111 AAA Todd 2 Tim 4
222 ABB Tony 6 Todd 5
333 BBB Tim 8 Sue 3 Jim 7
x=222, y=Tony, returned value = 6
x=111 y=Tim, returned value = 4
x=333 y=Jim, returned value = 7

Thanks in advance!

  #2   Report Post  
Posted to microsoft.public.excel.misc
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default find and return adjacent value (redux)!

Assuming your table is in A1:H3 and A11=222 and B11=Tony, this returns the
results you're after:

=INDEX(INDEX($A$1:$H$3,MATCH(A11,$A$1:$A$3,0),0),M ATCH(B11,INDEX($A$1:$H$3,MATCH(A11,$A$1:$A$3,0),0) ,0)+1)

There may be a shorter way, but it's past my bedtime.



"Todd Lietha" wrote:

I posted this earlier, but missed a key element in the example.

How would I do the following using a formula:

Find the row that contains value X, then in that row find the cell that
contains value Y, then return the value to the immediate right?

Example:
111 AAA Todd 2 Tim 4
222 ABB Tony 6 Todd 5
333 BBB Tim 8 Sue 3 Jim 7
x=222, y=Tony, returned value = 6
x=111 y=Tim, returned value = 4
x=333 y=Jim, returned value = 7

Thanks in advance!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default find and return adjacent value (redux)!

This requires DGet function. It's a Database and list management function.
The syntax for DGet function is:
DGET(database,field,criteria)
To turn to your case:
1. You have to create a range to fill the criteria
1.1. Criteria is nothing but the conditions you apply to restrict the result.
Say, x=222, y=Tony etc.,
2. Database is the range where you search results for your criteria
2.2. Remember the both the Database and criteria column headers should be
unique
3. Field is the column value that you want to return (result)
For more help go to Help menu.





"Todd Lietha" wrote:

I posted this earlier, but missed a key element in the example.

How would I do the following using a formula:

Find the row that contains value X, then in that row find the cell that
contains value Y, then return the value to the immediate right?

Example:
111 AAA Todd 2 Tim 4
222 ABB Tony 6 Todd 5
333 BBB Tim 8 Sue 3 Jim 7
x=222, y=Tony, returned value = 6
x=111 y=Tim, returned value = 4
x=333 y=Jim, returned value = 7

Thanks in advance!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default find and return adjacent value (redux)!

It would be better if you stayed with your original thread and added
additional information there.

The formula I suggested in that thread will do exactly as you're describing
here.
All you have to do is revise the ranges to meet the stipulations you posted
here.

From your original thread:
<<<"Try this *array* formula,
where you enter the "x" value in E1,
and the "y" value in E2:

=INDEX(A1:D3,MATCH(E1,A1:A3,0),MAX((A1:D3=E2)*COLU MN(A1:D3))+1
"


So, with your new datalist configuration,
Try this *array* formula,
where you enter the "x" value in J1,
and the "y" value in J2:

=INDEX(A1:H3,MATCH(J1,A1:A3,0),MAX((A1:H3=J2)*COLU MN(A1:H3))+1

--
Array formulas must be entered with CSE, <Ctrl <Shift <Enter, instead of
the regular <Enter, which will *automatically* enclose the formula in curly
brackets, which *cannot* be done manually. Also, you must use CSE when
revising the formula.

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Todd Lietha" wrote in message
...
I posted this earlier, but missed a key element in the example.

How would I do the following using a formula:

Find the row that contains value X, then in that row find the cell that
contains value Y, then return the value to the immediate right?

Example:
111 AAA Todd 2 Tim 4
222 ABB Tony 6 Todd 5
333 BBB Tim 8 Sue 3 Jim 7
x=222, y=Tony, returned value = 6
x=111 y=Tim, returned value = 4
x=333 y=Jim, returned value = 7

Thanks in advance!



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
find and return adjacent value Todd Lietha Excel Discussion (Misc queries) 2 September 25th 07 01:26 AM
search and return adjacent value JBS Excel Discussion (Misc queries) 8 June 14th 07 08:11 AM
Return value in adjacent cell TammyS Excel Worksheet Functions 5 August 30th 06 08:13 PM
return value in adjacent cell different workbook Don D Excel Worksheet Functions 4 May 2nd 06 11:37 PM
test a range of cells and return an adjacent value whub3 Excel Worksheet Functions 5 April 20th 06 01:04 AM


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