Comparing Cell Value With A Reference

H

hhalle

Hi,
I thought I had found the solution but is doesn't work:

I have a number of Cells which I have named and wish to check if th
value = a result in another cell:

for example:

A1 contains the string "NED"
In another sheet I have the country's name: Countries!A1 = "Nederland
and the cellname, reference is NED

so if I type in any other cell X1=NED the result = "Nederland"

Now I have a soccerpool and a test the result is WINNERA

In this cell is NED is the winner the value NED is selected

What I need to know is how can I compare:

IF WINNERA = NED Then ...... Else .....

Thanks, as you may understand it's for the Soccer World Championship i
Juni 2006

Hans:confused
 
B

Bob Phillips

I may be missing the question here, but you should be able to do

=IF(WINNERA=NED,"y","n")

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
R

ric_deez

Hi Hans,

Not sure if I understand your question but it seems like it is for a
worthy cause!!! ;-)

If you have the following information in your Countries worksheet
Col A Col B
NED Netherlands < row 1
BRA Brazil
MEX Mexico
....

You get the drift. Then in your other sheet you can do a VLOOKUP
function to return the name of the country based on the abbreviation.
So for example if you have "NED" in Cell A1 you can use in A2 =
VLOOKUP(A1,Countries!A1:B32,2,0).

or in VBA wks.range("A2").formulaR1C1 =
"=VLOOKUP(RC[-1],Countries!$A$1:$B$32,2,0)", where wks is a reference
for the worksheet where you are working out your soccerpools.

Is this what you mean?!?

If this does not answer your question, please post more information in
relation to your query...

Regards,

Ric
 
H

hhalle

Function IsThisOne(IsDeze1 As String, IsDeze2 As String) As Integer
IsThisOne = 0
If IsDeze1 <> "" Then ttt = Range(IsDeze1).Value Else ttt = ""
If ttt = IsDeze2 Then IsThisOne = 1
If ttt = "" Then IsThisOne = 0
End Function

What I had was that the default value is "", when a team wins WINA =
value of that team "NED"
So now in WINA = NED it's 1 else it's 0

Thanks to Ric and Bob for thier suggestions but I think this works just
fine, now let's hope NED wins?!?

Regards,

Hans
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top