Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default Finding a value based on contents of two cells

My list has 3 columns:

Column A Column B Column C
County State Office
Hall GA XYZ Office
Fulton GA ABC Office
Cuyahoga OH DEF Office

Etc, for about 500 rows.

I need to find the office that handles the county/state combo listed in
Column C. Some county names are replicated in other states, so I need
the one for the specific state.

The reference cells a County will be in cell G1, and State in H1.
These values are the result of a vlookup on another sheet.

How do I do this, please? Either a VBA or the formula would be great.

Thanks in advance.

Robert

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Finding a value based on contents of two cells

Try this:

Entered as an array using the key combination of CTRL,SHIFT,ENTER (not just
ENTER):

=IF(COUNTA(G1:H1)<2,"",INDEX(C2:C4,MATCH(1,(A2:A4= G1)*(B2:B4=H1),0)))

Biff

"xjetjockey" wrote in message
ups.com...
My list has 3 columns:

Column A Column B Column C
County State Office
Hall GA XYZ Office
Fulton GA ABC Office
Cuyahoga OH DEF Office

Etc, for about 500 rows.

I need to find the office that handles the county/state combo listed in
Column C. Some county names are replicated in other states, so I need
the one for the specific state.

The reference cells a County will be in cell G1, and State in H1.
These values are the result of a vlookup on another sheet.

How do I do this, please? Either a VBA or the formula would be great.

Thanks in advance.

Robert



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Finding a value based on contents of two cells

=INDEX(Sheet1!C2:C500,MATCH(1,(Sheet1!A2:A500=Shee t2!$G$1)*(Sheet1!B2:B500=Sheet2!$H$1),0))

Adjust to suit
ctrl+shift+enter (not just enter)


"xjetjockey" wrote:

My list has 3 columns:

Column A Column B Column C
County State Office
Hall GA XYZ Office
Fulton GA ABC Office
Cuyahoga OH DEF Office

Etc, for about 500 rows.

I need to find the office that handles the county/state combo listed in
Column C. Some county names are replicated in other states, so I need
the one for the specific state.

The reference cells a County will be in cell G1, and State in H1.
These values are the result of a vlookup on another sheet.

How do I do this, please? Either a VBA or the formula would be great.

Thanks in advance.

Robert


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default Finding a value based on contents of two cells

Perfect. Thanks a million, and happy new year to ya.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Finding a value based on contents of two cells

You're welcome. Thanks for the feedback!

Biff

"xjetjockey" wrote in message
oups.com...
Perfect. Thanks a million, and happy new year to ya.



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
counting cells based on conditional formatting Marc Excel Discussion (Misc queries) 3 July 5th 06 08:37 PM
Macro to highlight cells based on content JimDerDog Excel Worksheet Functions 1 February 1st 06 03:51 PM
how do i add in numbers automatically based on adjacent cells cont lemskibar Excel Discussion (Misc queries) 2 December 22nd 05 05:27 PM
Automatically filling in cells based on another cell's content Ginger Excel Worksheet Functions 5 September 2nd 05 09:17 AM
Excel should have the option to merge contents when merging cells. Ceiling Tile 01 Excel Discussion (Misc queries) 2 August 31st 05 11:03 PM


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