Can a VLookup be added to an IF Statement?

K

Kiley

I have an IF statement and I am wondering if a Vlookup can be added to the
formula?
 
T

T. Valko

Yes, but you'll need to provide some details on what the formula is supposed
to do.
 
D

David Biddulph

Yes.

For example =IF(A1=1,VLOOKUP(...),"something else") or
=IF(VLOOKUP(...)=A1,B1,C1)
 
K

Kiley

This what my IF statement looks like. I want to pull this information for a
particular employees using Employee ID as the lookup value. Let me know if
you need more information. Thank you.
 
T

T. Valko

Not enough info.

Tell us what it is you're looking for. Where do we look for it? See if this
helps:

...........A..........B
1........x..........north
2........y..........south
3........z..........east

D1 = y

=VLOOKUP(D1,A1:B3,2,0)

Result = south
 
K

Kiley

Sorry, I did not include what the IF statement. Here it is:

I am pulling in information from another workbook that is look at three sets
of data and I need to grab the one that ="y". That is how the IF statement
is set up. What I want to do is look at this IF statement for a a particular
employee. So, for example, I want to do a vlookup for employee number 12345
and apply the IF statement. Let me know if you still need more information.
Thank you.


=IF('K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet _04_30_09.xls]officer
data'!$AW$4="y",'K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet
_04_30_09.xls]officer data'!$AS$4,IF('K:\COMP\Mary\[TEMPLATE Off Mrt Summary
Sheet _04_30_09.xls]officer data'!$BD$4="y",'K:\COMP\Mary\[TEMPLATE Off Mrt
Summary Sheet _04_30_09.xls]officer data'!$AZ$4,IF('K:\COMP\Mary\[TEMPLATE
Off Mrt Summary Sheet _04_30_09.xls]officer
data'!$BK$4="y",'K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet
_04_30_09.xls]officer data'!$BG$4,"")))/1000
 
T

T. Valko

I don't see how VLOOKUP comes into play here. For one thing, VLOOKUP
searches to the right. Your formula is "searching" to the left.

There's nothing wrong with your formula other than it being kind of long due
to the extremely long file name.

--
Biff
Microsoft Excel MVP


Kiley said:
Sorry, I did not include what the IF statement. Here it is:

I am pulling in information from another workbook that is look at three
sets
of data and I need to grab the one that ="y". That is how the IF
statement
is set up. What I want to do is look at this IF statement for a a
particular
employee. So, for example, I want to do a vlookup for employee number
12345
and apply the IF statement. Let me know if you still need more
information.
Thank you.


=IF('K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet _04_30_09.xls]officer
data'!$AW$4="y",'K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet
_04_30_09.xls]officer data'!$AS$4,IF('K:\COMP\Mary\[TEMPLATE Off Mrt
Summary
Sheet _04_30_09.xls]officer data'!$BD$4="y",'K:\COMP\Mary\[TEMPLATE Off
Mrt
Summary Sheet _04_30_09.xls]officer data'!$AZ$4,IF('K:\COMP\Mary\[TEMPLATE
Off Mrt Summary Sheet _04_30_09.xls]officer
data'!$BK$4="y",'K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet
_04_30_09.xls]officer data'!$BG$4,"")))/1000


T. Valko said:
Not enough info.

Tell us what it is you're looking for. Where do we look for it? See if
this
helps:

...........A..........B
1........x..........north
2........y..........south
3........z..........east

D1 = y

=VLOOKUP(D1,A1:B3,2,0)

Result = south
 
K

Kiley

I want to add a vlookup to this IF statement. I am pulling in information
from another workbook that is looking at three sets of data and I need to
grab the one that ="y". That is how the IF statement is set up. What I want
to do is look at this IF statement for a particular employee. So, for
example, I want to do a vlookup for employee number 12345 and apply the IF
statement. Let me know if you still need more information.


T. Valko said:
I don't see how VLOOKUP comes into play here. For one thing, VLOOKUP
searches to the right. Your formula is "searching" to the left.

There's nothing wrong with your formula other than it being kind of long due
to the extremely long file name.

--
Biff
Microsoft Excel MVP


Kiley said:
Sorry, I did not include what the IF statement. Here it is:

I am pulling in information from another workbook that is look at three
sets
of data and I need to grab the one that ="y". That is how the IF
statement
is set up. What I want to do is look at this IF statement for a a
particular
employee. So, for example, I want to do a vlookup for employee number
12345
and apply the IF statement. Let me know if you still need more
information.
Thank you.


=IF('K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet _04_30_09.xls]officer
data'!$AW$4="y",'K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet
_04_30_09.xls]officer data'!$AS$4,IF('K:\COMP\Mary\[TEMPLATE Off Mrt
Summary
Sheet _04_30_09.xls]officer data'!$BD$4="y",'K:\COMP\Mary\[TEMPLATE Off
Mrt
Summary Sheet _04_30_09.xls]officer data'!$AZ$4,IF('K:\COMP\Mary\[TEMPLATE
Off Mrt Summary Sheet _04_30_09.xls]officer
data'!$BK$4="y",'K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet
_04_30_09.xls]officer data'!$BG$4,"")))/1000


T. Valko said:
Not enough info.

Tell us what it is you're looking for. Where do we look for it? See if
this
helps:

...........A..........B
1........x..........north
2........y..........south
3........z..........east

D1 = y

=VLOOKUP(D1,A1:B3,2,0)

Result = south

--
Biff
Microsoft Excel MVP


This what my IF statement looks like. I want to pull this information
for
a
particular employees using Employee ID as the lookup value. Let me
know
if
you need more information. Thank you.

:

Yes, but you'll need to provide some details on what the formula is
supposed
to do.

--
Biff
Microsoft Excel MVP


I have an IF statement and I am wondering if a Vlookup can be added
to
the
formula?
 
T

T. Valko

I'm not following you on this.

A lookup formula usually searches a table but your IF formula is looking at
single cells. Here's your IF formula reduced to just the cell references:

=IF(AW4="y",AS4,IF(BD4="y",AZ4,IF(BK4="y",BG4,"")))/1000

Refer back to my other reply where I posted a sample lookup table.

You say you want to lookup an employee number. Where is this employee
number? And, if the employee number is found where is the data that you want
returned? How does this relate to tour IF formula? You have to be *VERY
SPECIFIC* and provide the details.


--
Biff
Microsoft Excel MVP


Kiley said:
I want to add a vlookup to this IF statement. I am pulling in information
from another workbook that is looking at three sets of data and I need to
grab the one that ="y". That is how the IF statement is set up. What I
want
to do is look at this IF statement for a particular employee. So, for
example, I want to do a vlookup for employee number 12345 and apply the IF
statement. Let me know if you still need more information.


T. Valko said:
I don't see how VLOOKUP comes into play here. For one thing, VLOOKUP
searches to the right. Your formula is "searching" to the left.

There's nothing wrong with your formula other than it being kind of long
due
to the extremely long file name.

--
Biff
Microsoft Excel MVP


Kiley said:
Sorry, I did not include what the IF statement. Here it is:

I am pulling in information from another workbook that is look at three
sets
of data and I need to grab the one that ="y". That is how the IF
statement
is set up. What I want to do is look at this IF statement for a a
particular
employee. So, for example, I want to do a vlookup for employee number
12345
and apply the IF statement. Let me know if you still need more
information.
Thank you.


=IF('K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet _04_30_09.xls]officer
data'!$AW$4="y",'K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet
_04_30_09.xls]officer data'!$AS$4,IF('K:\COMP\Mary\[TEMPLATE Off Mrt
Summary
Sheet _04_30_09.xls]officer data'!$BD$4="y",'K:\COMP\Mary\[TEMPLATE Off
Mrt
Summary Sheet _04_30_09.xls]officer
data'!$AZ$4,IF('K:\COMP\Mary\[TEMPLATE
Off Mrt Summary Sheet _04_30_09.xls]officer
data'!$BK$4="y",'K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet
_04_30_09.xls]officer data'!$BG$4,"")))/1000


:

Not enough info.

Tell us what it is you're looking for. Where do we look for it? See if
this
helps:

...........A..........B
1........x..........north
2........y..........south
3........z..........east

D1 = y

=VLOOKUP(D1,A1:B3,2,0)

Result = south

--
Biff
Microsoft Excel MVP


This what my IF statement looks like. I want to pull this
information
for
a
particular employees using Employee ID as the lookup value. Let me
know
if
you need more information. Thank you.

:

Yes, but you'll need to provide some details on what the formula is
supposed
to do.

--
Biff
Microsoft Excel MVP


I have an IF statement and I am wondering if a Vlookup can be
added
to
the
formula?
 
K

Kiley

I have a workbook with a set of data which includes employee ID numbers, and
then three sets of data for each employee. Each set of data is identified
with a "y" or a "n". The IF statement (which is set up in another workbook)
is set up to pull the set of data that has been identified with a "y". My
goal is to be able to add a vlookup to the IF statement using employee ID
number to pull the "y" set of data for a particular employee. I would send
you what my data looks like, but I do not know if there is an option to
attach documents here. You help an patience is greatly appreciated.

T. Valko said:
I'm not following you on this.

A lookup formula usually searches a table but your IF formula is looking at
single cells. Here's your IF formula reduced to just the cell references:

=IF(AW4="y",AS4,IF(BD4="y",AZ4,IF(BK4="y",BG4,"")))/1000

Refer back to my other reply where I posted a sample lookup table.

You say you want to lookup an employee number. Where is this employee
number? And, if the employee number is found where is the data that you want
returned? How does this relate to tour IF formula? You have to be *VERY
SPECIFIC* and provide the details.


--
Biff
Microsoft Excel MVP


Kiley said:
I want to add a vlookup to this IF statement. I am pulling in information
from another workbook that is looking at three sets of data and I need to
grab the one that ="y". That is how the IF statement is set up. What I
want
to do is look at this IF statement for a particular employee. So, for
example, I want to do a vlookup for employee number 12345 and apply the IF
statement. Let me know if you still need more information.


T. Valko said:
I don't see how VLOOKUP comes into play here. For one thing, VLOOKUP
searches to the right. Your formula is "searching" to the left.

There's nothing wrong with your formula other than it being kind of long
due
to the extremely long file name.

--
Biff
Microsoft Excel MVP


Sorry, I did not include what the IF statement. Here it is:

I am pulling in information from another workbook that is look at three
sets
of data and I need to grab the one that ="y". That is how the IF
statement
is set up. What I want to do is look at this IF statement for a a
particular
employee. So, for example, I want to do a vlookup for employee number
12345
and apply the IF statement. Let me know if you still need more
information.
Thank you.


=IF('K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet _04_30_09.xls]officer
data'!$AW$4="y",'K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet
_04_30_09.xls]officer data'!$AS$4,IF('K:\COMP\Mary\[TEMPLATE Off Mrt
Summary
Sheet _04_30_09.xls]officer data'!$BD$4="y",'K:\COMP\Mary\[TEMPLATE Off
Mrt
Summary Sheet _04_30_09.xls]officer
data'!$AZ$4,IF('K:\COMP\Mary\[TEMPLATE
Off Mrt Summary Sheet _04_30_09.xls]officer
data'!$BK$4="y",'K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet
_04_30_09.xls]officer data'!$BG$4,"")))/1000


:

Not enough info.

Tell us what it is you're looking for. Where do we look for it? See if
this
helps:

...........A..........B
1........x..........north
2........y..........south
3........z..........east

D1 = y

=VLOOKUP(D1,A1:B3,2,0)

Result = south

--
Biff
Microsoft Excel MVP


This what my IF statement looks like. I want to pull this
information
for
a
particular employees using Employee ID as the lookup value. Let me
know
if
you need more information. Thank you.

:

Yes, but you'll need to provide some details on what the formula is
supposed
to do.

--
Biff
Microsoft Excel MVP


I have an IF statement and I am wondering if a Vlookup can be
added
to
the
formula?
 
T

T. Valko

You can upload a *small* sample file to a free file host then post the link
to the file. I use this one often:

http://tinyurl.com/24xfnt

That's a French site translated to English.

--
Biff
Microsoft Excel MVP


Kiley said:
I have a workbook with a set of data which includes employee ID numbers,
and
then three sets of data for each employee. Each set of data is identified
with a "y" or a "n". The IF statement (which is set up in another
workbook)
is set up to pull the set of data that has been identified with a "y". My
goal is to be able to add a vlookup to the IF statement using employee ID
number to pull the "y" set of data for a particular employee. I would
send
you what my data looks like, but I do not know if there is an option to
attach documents here. You help an patience is greatly appreciated.

T. Valko said:
I'm not following you on this.

A lookup formula usually searches a table but your IF formula is looking
at
single cells. Here's your IF formula reduced to just the cell references:

=IF(AW4="y",AS4,IF(BD4="y",AZ4,IF(BK4="y",BG4,"")))/1000

Refer back to my other reply where I posted a sample lookup table.

You say you want to lookup an employee number. Where is this employee
number? And, if the employee number is found where is the data that you
want
returned? How does this relate to tour IF formula? You have to be *VERY
SPECIFIC* and provide the details.


--
Biff
Microsoft Excel MVP


Kiley said:
I want to add a vlookup to this IF statement. I am pulling in
information
from another workbook that is looking at three sets of data and I need
to
grab the one that ="y". That is how the IF statement is set up. What
I
want
to do is look at this IF statement for a particular employee. So, for
example, I want to do a vlookup for employee number 12345 and apply the
IF
statement. Let me know if you still need more information.


:

I don't see how VLOOKUP comes into play here. For one thing, VLOOKUP
searches to the right. Your formula is "searching" to the left.

There's nothing wrong with your formula other than it being kind of
long
due
to the extremely long file name.

--
Biff
Microsoft Excel MVP


Sorry, I did not include what the IF statement. Here it is:

I am pulling in information from another workbook that is look at
three
sets
of data and I need to grab the one that ="y". That is how the IF
statement
is set up. What I want to do is look at this IF statement for a a
particular
employee. So, for example, I want to do a vlookup for employee
number
12345
and apply the IF statement. Let me know if you still need more
information.
Thank you.


=IF('K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet
_04_30_09.xls]officer
data'!$AW$4="y",'K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet
_04_30_09.xls]officer data'!$AS$4,IF('K:\COMP\Mary\[TEMPLATE Off Mrt
Summary
Sheet _04_30_09.xls]officer data'!$BD$4="y",'K:\COMP\Mary\[TEMPLATE
Off
Mrt
Summary Sheet _04_30_09.xls]officer
data'!$AZ$4,IF('K:\COMP\Mary\[TEMPLATE
Off Mrt Summary Sheet _04_30_09.xls]officer
data'!$BK$4="y",'K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet
_04_30_09.xls]officer data'!$BG$4,"")))/1000


:

Not enough info.

Tell us what it is you're looking for. Where do we look for it? See
if
this
helps:

...........A..........B
1........x..........north
2........y..........south
3........z..........east

D1 = y

=VLOOKUP(D1,A1:B3,2,0)

Result = south

--
Biff
Microsoft Excel MVP


This what my IF statement looks like. I want to pull this
information
for
a
particular employees using Employee ID as the lookup value. Let
me
know
if
you need more information. Thank you.

:

Yes, but you'll need to provide some details on what the formula
is
supposed
to do.

--
Biff
Microsoft Excel MVP


I have an IF statement and I am wondering if a Vlookup can be
added
to
the
formula?
 
K

Kiley

Unfortunately, that site is blocked :(

T. Valko said:
You can upload a *small* sample file to a free file host then post the link
to the file. I use this one often:

http://tinyurl.com/24xfnt

That's a French site translated to English.

--
Biff
Microsoft Excel MVP


Kiley said:
I have a workbook with a set of data which includes employee ID numbers,
and
then three sets of data for each employee. Each set of data is identified
with a "y" or a "n". The IF statement (which is set up in another
workbook)
is set up to pull the set of data that has been identified with a "y". My
goal is to be able to add a vlookup to the IF statement using employee ID
number to pull the "y" set of data for a particular employee. I would
send
you what my data looks like, but I do not know if there is an option to
attach documents here. You help an patience is greatly appreciated.

T. Valko said:
I'm not following you on this.

A lookup formula usually searches a table but your IF formula is looking
at
single cells. Here's your IF formula reduced to just the cell references:

=IF(AW4="y",AS4,IF(BD4="y",AZ4,IF(BK4="y",BG4,"")))/1000

Refer back to my other reply where I posted a sample lookup table.

You say you want to lookup an employee number. Where is this employee
number? And, if the employee number is found where is the data that you
want
returned? How does this relate to tour IF formula? You have to be *VERY
SPECIFIC* and provide the details.


--
Biff
Microsoft Excel MVP


I want to add a vlookup to this IF statement. I am pulling in
information
from another workbook that is looking at three sets of data and I need
to
grab the one that ="y". That is how the IF statement is set up. What
I
want
to do is look at this IF statement for a particular employee. So, for
example, I want to do a vlookup for employee number 12345 and apply the
IF
statement. Let me know if you still need more information.


:

I don't see how VLOOKUP comes into play here. For one thing, VLOOKUP
searches to the right. Your formula is "searching" to the left.

There's nothing wrong with your formula other than it being kind of
long
due
to the extremely long file name.

--
Biff
Microsoft Excel MVP


Sorry, I did not include what the IF statement. Here it is:

I am pulling in information from another workbook that is look at
three
sets
of data and I need to grab the one that ="y". That is how the IF
statement
is set up. What I want to do is look at this IF statement for a a
particular
employee. So, for example, I want to do a vlookup for employee
number
12345
and apply the IF statement. Let me know if you still need more
information.
Thank you.


=IF('K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet
_04_30_09.xls]officer
data'!$AW$4="y",'K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet
_04_30_09.xls]officer data'!$AS$4,IF('K:\COMP\Mary\[TEMPLATE Off Mrt
Summary
Sheet _04_30_09.xls]officer data'!$BD$4="y",'K:\COMP\Mary\[TEMPLATE
Off
Mrt
Summary Sheet _04_30_09.xls]officer
data'!$AZ$4,IF('K:\COMP\Mary\[TEMPLATE
Off Mrt Summary Sheet _04_30_09.xls]officer
data'!$BK$4="y",'K:\COMP\Mary\[TEMPLATE Off Mrt Summary Sheet
_04_30_09.xls]officer data'!$BG$4,"")))/1000


:

Not enough info.

Tell us what it is you're looking for. Where do we look for it? See
if
this
helps:

...........A..........B
1........x..........north
2........y..........south
3........z..........east

D1 = y

=VLOOKUP(D1,A1:B3,2,0)

Result = south

--
Biff
Microsoft Excel MVP


This what my IF statement looks like. I want to pull this
information
for
a
particular employees using Employee ID as the lookup value. Let
me
know
if
you need more information. Thank you.

:

Yes, but you'll need to provide some details on what the formula
is
supposed
to do.

--
Biff
Microsoft Excel MVP


I have an IF statement and I am wondering if a Vlookup can be
added
to
the
formula?
 

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