PC Review


Reply
Thread Tools Rate Thread

Compare numbers in to raws

 
 
Stig LA
Guest
Posts: n/a
 
      12th Feb 2010
I'm using Excel 2003
Can anybody help with programming this:
I have a column of numbers in F20:F33 I would like to check against an other
colums of numbers in A20:A23. All numbers are phone numbers - no parentheses.
If a number in F match a number in A, it should return a "Y" (for yes) in
the adressfield to the right for this number (say G28).
I tried to modify the IF COUNT IF in the thread shown in "Programming" on
the 10.02.2010 without succes.
The above ranges are arbitrary. The real ones are much much longer.

Thank you in advance.


 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      12th Feb 2010
use edit>FIND
record a macro while doing and then clean it up.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Stig LA" <Stig (E-Mail Removed)> wrote in message
news:66EF5F12-BFC6-4A1F-9713-(E-Mail Removed)...
> I'm using Excel 2003
> Can anybody help with programming this:
> I have a column of numbers in F20:F33 I would like to check against an
> other
> colums of numbers in A20:A23. All numbers are phone numbers - no
> parentheses.
> If a number in F match a number in A, it should return a "Y" (for yes) in
> the adressfield to the right for this number (say G28).
> I tried to modify the IF COUNT IF in the thread shown in "Programming" on
> the 10.02.2010 without succes.
> The above ranges are arbitrary. The real ones are much much longer.
>
> Thank you in advance.
>
>


 
Reply With Quote
 
JLatham
Guest
Posts: n/a
 
      12th Feb 2010
To just check if one in F is also in A, formula (for cell G20) would be:
=IF(COUNTIF(A$20:A$33)>0,"YES","NO")
but if there is already some text in G20 and you want to add the "YES/NO" to
that text then something like this:
="original text here like street address" & " Phone: " &
IF(COUNTIF(A$20:A$33)>0,"YES","NO")



"Stig LA" wrote:

> I'm using Excel 2003
> Can anybody help with programming this:
> I have a column of numbers in F20:F33 I would like to check against an other
> colums of numbers in A20:A23. All numbers are phone numbers - no parentheses.
> If a number in F match a number in A, it should return a "Y" (for yes) in
> the adressfield to the right for this number (say G28).
> I tried to modify the IF COUNT IF in the thread shown in "Programming" on
> the 10.02.2010 without succes.
> The above ranges are arbitrary. The real ones are much much longer.
>
> Thank you in advance.
>
>

 
Reply With Quote
 
JLatham
Guest
Posts: n/a
 
      12th Feb 2010
To explain the formula a bit: The heart of it is the COUNTIF() portion.
COUNTIF() needs 2 things; a list of cells to look through, and an indication
of what to look for in that list.

By writing the address for column A as A$20:A$33, it keeps the "cells to
look through" constantly pointing to the entire list no matter where we move
the formula to. And by writing the "what to look for" part as F2 (notice no
$ in it), it allows the 2 to increment as you fill the formula down the sheet.

So in cell G2, the formula would look like
=IF(COUNTIF(A$20:A$33,F2)>1,"YES","NO")
and after you copy/fill it down to F3, it looks like
=IF(COUNTIF(A$20:A$33,F3)>1,"YES","NO")

Of course you can change the row numbers in column A as required; for that
matter, if your list may get longer, you can even write the formula as
=IF(COUNTIF(A:A,F3)>1,"YES","NO")
and never have to worry about which rows in column A are involved at all.


"Stig LA" wrote:

> I'm using Excel 2003
> Can anybody help with programming this:
> I have a column of numbers in F20:F33 I would like to check against an other
> colums of numbers in A20:A23. All numbers are phone numbers - no parentheses.
> If a number in F match a number in A, it should return a "Y" (for yes) in
> the adressfield to the right for this number (say G28).
> I tried to modify the IF COUNT IF in the thread shown in "Programming" on
> the 10.02.2010 without succes.
> The above ranges are arbitrary. The real ones are much much longer.
>
> Thank you in advance.
>
>

 
Reply With Quote
 
sheryar khan
Guest
Posts: n/a
 
      13th Feb 2010
On Feb 12, 7:35*am, Stig LA <Stig L...@discussions.microsoft.com>
wrote:
> I'm using Excel 2003
> Can anybody help with programming this:
> I have a column of numbers in F20:F33 I would like to check against an other
> colums of numbers in A20:A23. All numbers are phone numbers - no parentheses.
> If a number in F match a number in A, it should return a "Y" (for yes) in
> the adressfield to the right for this number (say G28).
> I tried to modify the IF COUNT IF in the thread shown in "Programming" on
> the 10.02.2010 without succes.
> The above ranges are arbitrary. The real ones are much much longer.
>
> Thank you in advance.


Another approach

=IF(ISNUMBER(MATCH(F20,$A$20:$A$33,0)),"yes","no")

adjust ranges accordingly.

regards
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
compare 2 columns of numbers and place the matched numbers in a 3r Clive Microsoft Excel Misc 5 8th Nov 2009 12:50 AM
Compare numbers Abrm Microsoft Access Queries 2 25th Mar 2008 11:51 AM
VLOOKUP should compare numbers stored as text to plain numbers. =?Utf-8?B?VkxPT0tVUCAtIE51bWJlcnMgc3RvcmVkIGFzIHRl Microsoft Excel Worksheet Functions 0 31st Mar 2006 05:53 PM
Can't compare calculated numbers to imported numbers =?Utf-8?B?bWlkLW5vdmljZSB1c2Vy?= Microsoft Access Queries 1 23rd Dec 2005 03:07 PM
Compare numbers Alan Microsoft Excel Worksheet Functions 3 28th May 2004 06:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:37 PM.