×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Comparing barcode data to a column in Excel

Comparing barcode data to a column in Excel

Comparing barcode data to a column in Excel

(OP)
I am trying to compare a barcode to a list (column) in Excel. I've found ways to compare a column to column but I haven't found how to compare one string to an entire column.

Trying to verify that we don't have redundant barcodes.

Thanks
Doug

RE: Comparing barcode data to a column in Excel

Use the FIND command
If your column is in A1:C30 and the barcode string is stored in B1 then copy this into C1:C30:

=FIND(B1,A1)

Then column C will show #VALUE! if the string in not present or a number which is the start postion where the string is first found if present.

RE: Comparing barcode data to a column in Excel

That is probably =FIND($B$1, A1) for cell C1, and copy down. In cell C30 you should get =FIND($B$1, A30)

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

RE: Comparing barcode data to a column in Excel

Thanks joerd, I forgot about fixing the string to find...

RE: Comparing barcode data to a column in Excel

(OP)
I got the FIND command to work.
Thanks!
I also was able to get the EXACT command to work. The only problem I have is I would like the answer in 1 cell only. For example, if the code in A1 matched any of the codes in B1:B6000 then C1 would be TRUE or 1.

I am using that cell(answer) in some VB for a different machine.

RE: Comparing barcode data to a column in Excel

Then you should use COUNTIF, for example:
=(COUNTIF($B$1:$B$6000,A1)>0)
COUNTIF gives you the number of occurrences in the range B1:B6000 where the value equals A1. If it is greater than 0, the boolean expression evaluates to TRUE.

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

RE: Comparing barcode data to a column in Excel

(OP)
Thank You.
CountIf does all I needed.


Thanks
Doug

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources