ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Match or Lookup formula help please (https://www.excelbanter.com/excel-worksheet-functions/203233-match-lookup-formula-help-please.html)

Soth

Match or Lookup formula help please
 
Column A Column B Colum C

John John = return value of 1, if matches, else 2
Smith Bob
Mary Jennifer

I like to have a formula in column C, if item in column A, "John" matches
item in column B "John", then show value of #1, else, #2

Thank you,
Soth



T. Valko

Match or Lookup formula help please
 
Do you mean items that match *on the same row* or do you mean items that
match *anywhere* within the range?

--
Biff
Microsoft Excel MVP


"Soth" wrote in message
...
Column A Column B Colum C

John John = return value of 1, if matches, else 2
Smith Bob
Mary Jennifer

I like to have a formula in column C, if item in column A, "John" matches
item in column B "John", then show value of #1, else, #2

Thank you,
Soth





Soth

Match or Lookup formula help please
 
Hi,

I meant item matches 'anywhere' within the range. Thanks

"T. Valko" wrote:

Do you mean items that match *on the same row* or do you mean items that
match *anywhere* within the range?

--
Biff
Microsoft Excel MVP


"Soth" wrote in message
...
Column A Column B Colum C

John John = return value of 1, if matches, else 2
Smith Bob
Mary Jennifer

I like to have a formula in column C, if item in column A, "John" matches
item in column B "John", then show value of #1, else, #2

Thank you,
Soth






T. Valko

Match or Lookup formula help please
 
Try this:

=IF(COUNTIF(A$1:A$20,B1),1,2)

Copy to the end of data in column B. Adjust ranges to suit.

--
Biff
Microsoft Excel MVP


"Soth" wrote in message
...
Hi,

I meant item matches 'anywhere' within the range. Thanks

"T. Valko" wrote:

Do you mean items that match *on the same row* or do you mean items that
match *anywhere* within the range?

--
Biff
Microsoft Excel MVP


"Soth" wrote in message
...
Column A Column B Colum C

John John = return value of 1, if matches,
else 2
Smith Bob
Mary Jennifer

I like to have a formula in column C, if item in column A, "John"
matches
item in column B "John", then show value of #1, else, #2

Thank you,
Soth








Soth

Match or Lookup formula help please
 
Thank you very much. You've solved it.


"T. Valko" wrote:

Try this:

=IF(COUNTIF(A$1:A$20,B1),1,2)

Copy to the end of data in column B. Adjust ranges to suit.

--
Biff
Microsoft Excel MVP


"Soth" wrote in message
...
Hi,

I meant item matches 'anywhere' within the range. Thanks

"T. Valko" wrote:

Do you mean items that match *on the same row* or do you mean items that
match *anywhere* within the range?

--
Biff
Microsoft Excel MVP


"Soth" wrote in message
...
Column A Column B Colum C

John John = return value of 1, if matches,
else 2
Smith Bob
Mary Jennifer

I like to have a formula in column C, if item in column A, "John"
matches
item in column B "John", then show value of #1, else, #2

Thank you,
Soth









dan dungan

Match or Lookup formula help please
 
Hi Soth,

If your list starts in A1, adjust $b$1:$b:$3 to accommodate the entire
list and past the formula below down column c?

=IF(ISERROR(MATCH(A1,$B$1:$B$3,FALSE)),2,MATCH(A1, $B$1:$B$3,FALSE))

Does this work for you?

Dan

T. Valko

Match or Lookup formula help please
 
You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Soth" wrote in message
...
Thank you very much. You've solved it.


"T. Valko" wrote:

Try this:

=IF(COUNTIF(A$1:A$20,B1),1,2)

Copy to the end of data in column B. Adjust ranges to suit.

--
Biff
Microsoft Excel MVP


"Soth" wrote in message
...
Hi,

I meant item matches 'anywhere' within the range. Thanks

"T. Valko" wrote:

Do you mean items that match *on the same row* or do you mean items
that
match *anywhere* within the range?

--
Biff
Microsoft Excel MVP


"Soth" wrote in message
...
Column A Column B Colum C

John John = return value of 1, if matches,
else 2
Smith Bob
Mary Jennifer

I like to have a formula in column C, if item in column A, "John"
matches
item in column B "John", then show value of #1, else, #2

Thank you,
Soth












All times are GMT +1. The time now is 09:16 AM.

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