Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help in Comparing cell Values of two columns

Status
Not open for further replies.

susmitapati

Programmer
May 15, 2008
3
US
Hi All

I am new to Macro

I have this scenario where i have a file with id, customer id and unique customer columns. I have the example below in this posting. I need to check the values of first column(id), for each id then i need to check the second column (for customer id) if they are more then one customer id (for each id)i need to update the third column saying 'Y' for unique customer and 'N' for not unique customer.

I am struggling with this. Pls help and i have a deadline of today to submit this file and i have lakhs of records to verify

pls help!

Thanks
Susmita

Id CUSTOMER_ID Unique Cust
15272 13083 Y
15272 13083 Y
15516 724977 N
15516 724978 N
 




Hi,

You don't need a macro. Use the SUMPRODUCT function in an adjacent column. Assuming that your CUSTOMER_ID is in Column B from row 2 thru 10...
[tt]
=if(sumproduct(--($A$2:$A$10=A2)*($B$2:$B$10=B2))>1,"Y","N")
[tt]
copy down.

Skip,

[glasses]Just traded in my old subtlety...
for a brand NUANCE![tongue]
 
Thanks For the pointer.
I tried it out - works for the ones which should have the flag set to 'Y' but doesnt work for the ones where it should be set to 'N'
 
formula works for conditions where it shud be Y.

But in case where it shud be N - it doesnt work
For example in - id 15516 it has two different customer id - i want the third column to be populates as N

15516 724977 N
15516 724978 N


Let me know if i am clearwhat i want to achieve.

Thanks
Susmita
 




I copies your data and applied my formula and it works perfectly!

Hit F9 to calculate!

Skip,

[glasses]Just traded in my old subtlety...
for a brand NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top