ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Conditional formula with text (https://www.excelbanter.com/excel-worksheet-functions/250066-conditional-formula-text.html)

Mike[_26_]

Conditional formula with text
 
Hello, I'm trying to put together a formula in one worksheet that is
dependent on text existing in another worksheet.

Sheet 1
A1=Kentucky B1=(formula)

Sheet 2
A1=1 B1=Oregon
A2=2 B2=Kentucky
A3=3 B3=Arizona

Basically, I need to calculate a formula in Sheet 1 where if Sheet 2
contains "Kentucky" it would return the value in the "A" column next to
"Kentucky" in Sheet 2, which is in this case "2".

Can you help me put this formula together? Thanks!

Mike

Max

Conditional formula with text
 
An index/match should serve you well, you can use it to return any col to the
left or right of the match col

In Sheet1,
In B1: =INDEX(Sheet2!A:A,MATCH(A1,Sheet2!B:B,0))
Copy down

Or, with an error trap bolted on, in B1:
=IF(ISNA(MATCH(A1,Sheet2!B:B,0)),"",INDEX(Sheet2!A :A,MATCH(A1,Sheet2!B:B,0)))
Success? hit the YES below
--
Max
Singapore
xde
---
"Mike" wrote:
Hello, I'm trying to put together a formula in one worksheet that is
dependent on text existing in another worksheet.

Sheet 1
A1=Kentucky B1=(formula)

Sheet 2
A1=1 B1=Oregon
A2=2 B2=Kentucky
A3=3 B3=Arizona

Basically, I need to calculate a formula in Sheet 1 where if Sheet 2
contains "Kentucky" it would return the value in the "A" column next to
"Kentucky" in Sheet 2, which is in this case "2".

Can you help me put this formula together? Thanks!

Mike



All times are GMT +1. The time now is 01:14 PM.

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