ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how to search in excel with condition (https://www.excelbanter.com/excel-discussion-misc-queries/12143-how-search-excel-condition.html)

David

how to search in excel with condition
 
First I must say that your site is great and it helps me a lot.

Can you explaine to me how to do search in Excel ?

explenation:

I have 2 sheets on the same excel file. I need to search one column in the
2nd sheet and if i found the data I look for then I need excel to put this
data in the first sheet on the same raw when the data is equel to.

example:
1. on sheet 1 I have names of people.
2. on sheet 2 I have a cloumn that contains some of the names from sheet 1.
3. I need excel take each raw in sheet 1 and search sheet 2 for the same
name.
4. if it found the same name in sheet 2 then it will write on sheet 1 "OK"
if it does not find it it will write "NO"

Any ideas how to do that ?

Thanks,
David

Dave O

One way to do this is using the COUNTIF() formula. Supposing your
names in both Sheet1 and Sheet2 are in column A, I wrote this formula
in Sheet1 cell B1:
=COUNTIF(Sheet2!A:A,A1)

This will return the *number* of times that the name in Sheet1 appears
in Sheet2. Is that of any use? It's more informative than "OK" and
"NO" responses. If you need the OK and NO then use this formula:
=IF(COUNTIF(Sheet2!A:A,A1)0,"OK","NO")

A caveat: If "Sam Spade" appears in Sheet1 and "Samuel Spade" appears
in Sheet2, no match will be found. Similarly, "Ed Bagley, Jr." will
not be matched to "Ed Bagley Jr" because of the punctuation difference.



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

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