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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vlookup Excel 03

Status
Not open for further replies.

sumncguy

IS-IT--Management
May 22, 2006
118
US

I start out with a list of ip addresses a1-a8.
I use the data set in a1-a8 to perform some function within the unix environment that returns a list completions; another list of ip addresses.
I am trying to figure out how to use Vlookup to compare the
two columns. If an ip address is in column a and in column c
then put the word yes in column b, if not put no in column b.

kind of linke this


COLUMN Column Column
a1-a8 b c
10.10.10.10 Yes 10.10.10.10
10.10.10.11 Yes 10.10.10.11
10.10.10.12 No 10.10.10.13
10.10.10.13 Yes 10.10.10.15
10.10.10.14 No 10.10.10.17
10.10.10.15 Yes
10.10.10.16 No
10.10.10.17 Yes


This would tell me that I have problem with the no's and Id have to go back and check.

Im having a hard time finding examples of vlookup Ozgrid usually is able to answer my questions , but this one is
a killer

=VLOOKUP($A1,$C$1:$C$5,1) returns this ..

10.10.10.10 10.10.10.10 10.10.10.10
10.10.10.11 10.10.10.11 10.10.10.11
10.10.10.12 10.10.10.11 10.10.10.13
10.10.10.13 10.10.10.11 10.10.10.15
10.10.10.14 10.10.10.14 10.10.10.17
10.10.10.15 10.10.10.15
10.10.10.16 10.10.10.15
10.10.10.17 10.10.10.17


HELP PLEASE .. Getting ready to pull what hair I have left out.


 
I'd use COUNTIF instead

[tab]=CountIf(C:C, A1)

That will return TRUE if it is found and FALSE if it is not.

If you really want YES and NO, you'll use an IF statement.

[tab]=IF(CountIf(C:C, A1)>0, "YES", "NO")

And, FYI, to use VLookup, you'd also use an IF, but add in IsError or IsNA. Something like =If(IsNA(Vlookup....

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 

Thanks John. Works like a charm.
=IF(CountIf(C:C, A1)>0, "YES", "NO")

=IF(COUNTIF($I$1:$I$76, G2)>0, "YES", "NO")

10.1.1.10 NO
10.1.1.11 YES 10.1.1.11
10.1.1.12 YES 10.1.1.12
10.1.1.13 YES 10.1.1.13
10.1.1.14 YES 10.1.1.14
10.1.1.15 YES 10.1.1.15
10.1.1.16 YES 10.1.1.16
10.1.1.17 YES 10.1.1.17
10.1.1.20 YES 10.1.1.20
10.1.1.21 YES 10.1.1.21
10.1.1.22 YES 10.1.1.22
10.1.1.23 YES 10.1.1.23
10.1.1.24 YES 10.1.1.24
10.1.1.25 YES 10.1.1.25
10.1.1.26 YES 10.1.1.26
10.1.1.27 YES 10.1.1.27
10.1.1.28 YES 10.1.1.28
10.1.1.29 YES 10.1.1.29
10.1.1.3 YES 10.1.1.3
10.1.1.30 YES 10.1.1.30
10.1.1.31 YES 10.1.1.31
10.1.1.5 YES 10.1.1.5
10.1.1.6 YES 10.1.1.6
10.1.1.7 YES 10.1.1.7
10.1.1.8 YES 10.1.1.8
10.1.1.9 YES 10.1.1.9
10.1.122.102 YES 10.1.122.102
10.1.122.109 YES 10.1.122.109
10.1.122.114 YES 10.1.122.114
10.1.122.133 YES 10.1.122.133
10.1.122.137 YES 10.1.122.137
10.1.122.34 YES 10.1.122.34
10.1.122.78 YES 10.1.122.78
10.1.122.82 YES 10.1.122.82
10.1.128.13 YES 10.1.128.13
10.1.128.17 YES 10.1.128.17
10.1.128.21 YES 10.1.128.21
10.1.128.25 YES 10.1.128.25
10.1.128.29 YES 10.1.128.29
10.1.128.30 YES 10.1.128.30
10.1.128.35 YES 10.1.128.35
10.1.128.40 YES 10.1.128.40
10.1.128.45 YES 10.1.128.45
10.1.128.5 YES 10.1.128.5
10.1.128.50 YES 10.1.128.50
10.1.128.55 YES 10.1.128.55
10.1.128.6 YES 10.1.128.6
10.1.128.60 NO 10.1.155.5
10.1.128.65 NO 10.1.156.5
10.1.138.8 NO 10.1.156.6
10.1.150.5 NO 10.1.157.5
10.1.151.5 NO 10.1.157.6
10.1.152.5 NO 10.1.192.10
10.1.153.5 NO 10.1.192.11
10.1.154.5 NO 10.1.192.12
10.1.155.5 YES 10.1.192.4
10.1.156.5 YES 10.1.192.5
10.1.156.6 YES 10.1.192.6
10.1.157.5 YES 10.1.193.5
10.1.157.6 YES 10.1.195.5
10.1.192.10 YES 10.1.196.5
10.1.192.11 YES 10.1.197.5
10.1.192.12 YES 10.1.198.5
10.1.192.4 YES 10.1.2.26
10.1.192.5 YES 10.1.2.27
10.1.192.6 YES 10.1.20.2
10.1.193.5 YES 10.1.200.5
10.1.195.5 YES 10.1.201.8
10.1.196.5 YES 10.1.208.5
10.1.197.5 YES 10.1.209.5
10.1.198.5 YES 10.1.210.5
10.1.2.26 YES 10.1.211.5
10.1.2.27 YES 10.1.212.5
10.1.20.2 YES 10.1.213.5
10.1.200.5 YES 10.1.214.5
10.1.201.8 YES
10.1.208.5 YES
10.1.209.5 YES
10.1.210.5 YES
10.1.211.5 YES
10.1.212.5 YES
10.1.213.5 YES
10.1.214.5 YES
10.1.215.5 NO
10.1.23.6 NO
10.1.23.7 NO
10.1.23.8 NO
10.1.236.5 NO
10.1.237.5 NO
10.1.238.5 NO
10.1.239.5 NO
10.1.240.5 NO
10.1.241.5 NO
10.1.244.5 NO




I would have never figured it out. Owe ya a Guiness or Latte

Regards
 
I know you have solved your issue but to help yopur better understanding of excel:
=VLOOKUP($A1,$C$1:$C$5,1)
should be
=VLOOKUP($A1,$C$1:$C$5,[red]0[/red])

1=True, 0 = False
From Excel Help:
Range_lookup is a logical value that specifies whether you want VLOOKUP to find an exact match or an approximate match. If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned. If FALSE, VLOOKUP will find an exact match. If one is not found, the error value #N/A is returned.




Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top