ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Finding a value based on contents of two cells (https://www.excelbanter.com/excel-worksheet-functions/124393-finding-value-based-contents-two-cells.html)

xjetjockey

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


T. Valko

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




Teethless mama

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



xjetjockey

Finding a value based on contents of two cells
 
Perfect. Thanks a million, and happy new year to ya.


T. Valko

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.





All times are GMT +1. The time now is 05:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com