Skip to content
BOL Conferences
Thread Options Tools
#1648051 - 01/09/12 05:43 PM Excel: compare cell to a column
Cowboys Fan Offline
Power Poster
Joined: Dec 2002
Posts: 4,616
SC
I'm stuck. I have a cell (B2) that is a concatenation of 5 other cells (contains numbers, letters, symbols, etc). I have a column (A) that contains a list of thousands of account numbers. I want to compare the contents of the cell to the entire column to see if it contains any of the account numbers listed in the Column A. Anyone have any ideas?
_________________________

Return to Top
General Discussion
#1648076 - 01/09/12 05:58 PM Re: Excel: compare cell to a column Cowboys Fan
mtngrrl Online
Platinum Poster
mtngrrl
Joined: Mar 2011
Posts: 500
Northern California
Do you need to compare the whole value in cell B2, or a string within B2?
_________________________
Be kind; everyone you meet is fighting a hard battle.
--all opinions are my own--

Return to Top
#1648079 - 01/09/12 06:14 PM Re: Excel: compare cell to a column Cowboys Fan
Cowboys Fan Offline
Power Poster
Joined: Dec 2002
Posts: 4,616
SC
I need it to look at everything within B2 to see if any of the loan numbers are buried in it. B2 - no rhyme or reason to the structure of this cell because I'm pulling in free-form comments that were added to the account.
_________________________

Return to Top
#1648083 - 01/09/12 06:04 PM Re: Excel: compare cell to a column Cowboys Fan
mtngrrl Online
Platinum Poster
mtngrrl
Joined: Mar 2011
Posts: 500
Northern California
If it's the whole value, try this:

1. insert a column between A and B (you can hide it later). Your lookup field is now C2
2. add a text field like "match" to the new field for every record
3. assign a name to the range for columns A and the new B (for instance, "account")
4. add another new column, d, for the results of your match
5. use vlookup formula in cell d2:
=VLOOKUP(C2,match,2,FALSE)

If you need more help, feel free to pm me
_________________________
Be kind; everyone you meet is fighting a hard battle.
--all opinions are my own--

Return to Top
#1648084 - 01/09/12 06:05 PM Re: Excel: compare cell to a column Cowboys Fan
mtngrrl Online
Platinum Poster
mtngrrl
Joined: Mar 2011
Posts: 500
Northern California
Oops, just saw your reply. It will be a little more complicated...
_________________________
Be kind; everyone you meet is fighting a hard battle.
--all opinions are my own--

Return to Top
#1648097 - 01/09/12 06:19 PM Re: Excel: compare cell to a column Cowboys Fan
mtngrrl Online
Platinum Poster
mtngrrl
Joined: Mar 2011
Posts: 500
Northern California
_________________________
Be kind; everyone you meet is fighting a hard battle.
--all opinions are my own--

Return to Top
#1648099 - 01/09/12 06:35 PM Re: Excel: compare cell to a column Cowboys Fan
Cowboys Fan Offline
Power Poster
Joined: Dec 2002
Posts: 4,616
SC
Thanks - I'll give it a shot.
_________________________

Return to Top
#1648410 - 01/10/12 02:42 PM Re: Excel: compare cell to a column Cowboys Fan
doobydoobydoo Offline
Power Poster
doobydoobydoo
Joined: May 2007
Posts: 4,195
Basking in the Cool Weather
cowboys,

is your concatenation a fixed number of characters?

It would be easy to strip out the account number portion and then run the vlookup
_________________________
I'll be in the hospital bar.
Uh, you know there isn't a hospital bar, Mother.
Well, this is why people hate hospitals.

Return to Top
#1648521 - 01/10/12 04:40 PM Re: Excel: compare cell to a column Cowboys Fan
Cowboys Fan Offline
Power Poster
Joined: Dec 2002
Posts: 4,616
SC
Unfortunately it's not.
_________________________

Return to Top
#1648547 - 01/10/12 05:23 PM Re: Excel: compare cell to a column Cowboys Fan
doobydoobydoo Offline
Power Poster
doobydoobydoo
Joined: May 2007
Posts: 4,195
Basking in the Cool Weather
try

IF(ISNUMBER(SEARCH("*YOUR ACCOUNT NUMBER*",A1)),"YOUR ACCOUNT NUMBER","")


That will do the following, will search the cell for the string of account number.... if it finds it, it will return the character number that it begins in that cell if it doesnt find it, N/A


the IS NUMBER then would react to the character number and return your account number if it is in there or nothing if it is not
_________________________
I'll be in the hospital bar.
Uh, you know there isn't a hospital bar, Mother.
Well, this is why people hate hospitals.

Return to Top
#1650266 - 01/12/12 06:55 PM Re: Excel: compare cell to a column Cowboys Fan
doobydoobydoo Offline
Power Poster
doobydoobydoo
Joined: May 2007
Posts: 4,195
Basking in the Cool Weather
DId that do the trick?
_________________________
I'll be in the hospital bar.
Uh, you know there isn't a hospital bar, Mother.
Well, this is why people hate hospitals.

Return to Top
#1650589 - 01/13/12 11:43 AM Re: Excel: compare cell to a column Cowboys Fan
Cowboys Fan Offline
Power Poster
Joined: Dec 2002
Posts: 4,616
SC
Unfortunately no. I finally just highlighted the 5 columns and used Find so I could finish the project. But the link that mtngrrl gave me has some interesting possibilities that I'm going to keep trying.
_________________________

Return to Top
#1650595 - 01/13/12 12:40 PM Re: Excel: compare cell to a column Cowboys Fan
rlcarey Offline
10K Club
rlcarey
Joined: Jul 2001
Posts: 83,396
Galveston, TX
Try this:

IF(ISNUMBER(FIND(B1,A1),"TRUE","FALSE"))

or

=NOT(ISERROR(SEARCH(A1,B1)))

I think you have to have the cells formatted as "text" for the second one. You might have to switch the A1 and B1 as I can't remember exactly which way the search works off the top of my head.
_________________________
The opinions expressed here should not be construed to be those of my employer: PPDocs.com

Return to Top
#1650601 - 01/13/12 12:50 PM Re: Excel: compare cell to a column doobydoobydoo
Retired DQ Offline
10K Club
Retired DQ
Joined: Dec 2002
Posts: 40,766
Turnpike Exit 10
Originally Posted By: DoobyDoobyDoo
cowboys,

is your concatenation a fixed number of characters?

It would be easy to strip out the account number portion and then run the vlookup



I had to look it up:

con·cat·e·nate adj (kän-ˈka-tə-nət, kən-)
Definition of CONCATENATE
: linked together
_________________________
Get your facts first, then you can distort them as you please. - Mark Twain

Return to Top