A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Creating a dynamic IF statement



 
 
Thread Tools Display Modes
  #1  
Old February 17th, 2010, 04:22 PM posted to microsoft.public.excel.worksheet.functions
Robert Robinson
external usenet poster
 
Posts: 22
Default Creating a dynamic IF statement

I have data in two sheets. I want to create an IF statement in the second
sheet that has the ability to scan the first sheet for a value. If it finds a
match to a value in the second sheet, deposit the value into the
corresponding cells of sheet two. My example:

Sheet 1
User B 12/10
User C 12/15

Sheet 2
User A
User B

In this example, I will have the IF statement in column B of Sheet 2. I want
the IF statement to scan column A in sheet 1 for matches to column A of sheet
2. If it finds a match, place the corresponding value in column B (in this
case, it would find a match in User B and deposit 12/10 in column B of sheet
2. If it does not find a match, it leaves column B blank.

I can create a static IF link from sheet 2 to sheet 1; however, the
populations of sheets 2 and 1 are different. In addition, the populations of
sheets 2 and 1 will be ever changing, thus, I need to be able to create the
dynamic IF statements. Would I nest a VLOOKUP in the IF statement to get this
done, or is there another function that I should use?
--
Robert Robinson
  #2  
Old February 17th, 2010, 04:58 PM posted to microsoft.public.excel.worksheet.functions
Bernard Liengme
external usenet poster
 
Posts: 516
Default Creating a dynamic IF statement

What is wrong with =VLOOKUP(A1,Sheet1!A:B,2,FALSE)
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme


"Robert Robinson" wrote in
message ...
I have data in two sheets. I want to create an IF statement in the second
sheet that has the ability to scan the first sheet for a value. If it
finds a
match to a value in the second sheet, deposit the value into the
corresponding cells of sheet two. My example:

Sheet 1
User B 12/10
User C 12/15

Sheet 2
User A
User B

In this example, I will have the IF statement in column B of Sheet 2. I
want
the IF statement to scan column A in sheet 1 for matches to column A of
sheet
2. If it finds a match, place the corresponding value in column B (in this
case, it would find a match in User B and deposit 12/10 in column B of
sheet
2. If it does not find a match, it leaves column B blank.

I can create a static IF link from sheet 2 to sheet 1; however, the
populations of sheets 2 and 1 are different. In addition, the populations
of
sheets 2 and 1 will be ever changing, thus, I need to be able to create
the
dynamic IF statements. Would I nest a VLOOKUP in the IF statement to get
this
done, or is there another function that I should use?
--
Robert Robinson


  #3  
Old February 17th, 2010, 05:09 PM posted to microsoft.public.excel.worksheet.functions
Luke M
external usenet poster
 
Posts: 2,672
Default Creating a dynamic IF statement

I think you can do something like this:

=IF(ISNA(MATCH(A2,'Sheet 1'!A:A,0)),"",VLOOKUP(A2,A:B,2,FALSE))
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Robert Robinson" wrote:

I have data in two sheets. I want to create an IF statement in the second
sheet that has the ability to scan the first sheet for a value. If it finds a
match to a value in the second sheet, deposit the value into the
corresponding cells of sheet two. My example:

Sheet 1
User B 12/10
User C 12/15

Sheet 2
User A
User B

In this example, I will have the IF statement in column B of Sheet 2. I want
the IF statement to scan column A in sheet 1 for matches to column A of sheet
2. If it finds a match, place the corresponding value in column B (in this
case, it would find a match in User B and deposit 12/10 in column B of sheet
2. If it does not find a match, it leaves column B blank.

I can create a static IF link from sheet 2 to sheet 1; however, the
populations of sheets 2 and 1 are different. In addition, the populations of
sheets 2 and 1 will be ever changing, thus, I need to be able to create the
dynamic IF statements. Would I nest a VLOOKUP in the IF statement to get this
done, or is there another function that I should use?
--
Robert Robinson

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:45 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.