# If formula or Vlookup?

#### itshewe

##### New Member
Hi,

Is it possible to create a formula based on two dependent variables?

for example:

Sheet 1: I have stock with the code nr of "90" and daily stock return for this stock between 2007-2014.

Sheet 2: I have announcements made by different companies between the time interval of 2007/01/01 to 2014/07/07

so my question is, can i create a formula which finds that "If the "stock code" in sheet 1 is equal to the "stock code" on sheet 2 AND if the date on sheet 2 is equal to the date on sheet 2 THEN write Announcement or else nothing.

maybe the picture below gives you guys an idea:

http://s22.postimg.org/ygl2k9djl/Example.jpg

Please let me know if you guys need any further information

Thanks in advance
Hewe

#### jono19872006

##### Board Regular
Something like

=if(AND(stockcode=stockcode,date=date),"announcement","")

where stockcode and date would obviously need to be replaced with the 4 cell references
and announcement with the announcement..

eg =IF(AND(sheet1!A36=sheet2!A36,sheet1!A37=sheet2!A37),C36,"")

#### itshewe

##### New Member
Something like

=if(AND(stockcode=stockcode,date=date),"announcement","")

where stockcode and date would obviously need to be replaced with the 4 cell references
and announcement with the announcement..

eg =IF(AND(sheet1!A36=sheet2!A36,sheet1!A37=sheet2!A37),C36,"")
Sorry it did not work =(

I have uploaded another picture which might discribe the issue better.

http://s12.postimg.org/tw5dbsefx/EXAMPLE_2.jpg

The read "announcement" is what I want to achive by draging the formula or else false.

Hope you understand!

Kind regards
Hewe

Threads
1,082,601
Messages
5,366,571
Members
400,902
Latest member
fathima