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

Excel If Statement

Status
Not open for further replies.

teebird

Technical User
Dec 11, 2001
239
Hi All I am trying to get this If statement to work

=IF(MyPeriod=B2,MyMonth1=D2,"")

If the vale in MyPeriod is the same as the value in B2 then the value in MyMonth1 equals D2

MyPeriod is a dropdown list containing a period range eg Qrt1, Qrt2, Qrt3, Qrt4
B2 is a value matching the value in MyPeriod
MyMonth1 is to display a value from D2 depending on what is in MyPeriod.


 
Where are you entering this formula? It looks like you need to enter the following into the named cell MyMonth1:

=If(MyPeriod=B2,D2,"")

Is this what you need?

Fen
 
As Fen has said, you need to enter that formula in the cell you want the value to appear. A formula in Excel can only PULL a value into the cell the formula resides in, it cannot PUSH a value into another cell. To do that requires VBA (ie a macro).

Regards
Ken.............

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]
----------------------------------------------------------------------------
 



I think that what you want is a formula in D2...
[tt]
D2: =IF(MyPeriod=B2,MyMonth1,"")
[/tt]


Skip,

[glasses] [red][/red]
[tongue]
 
many thanks for your replies.

I have decided against this If statement as I can not get it to work. Now I am trying a lookup table with a formula but still having problems. Guess I will have to do more research...

 
If you describe what it is you are trying to accomplish, someone here can probably help point you in the right direction.

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

Help us help you. Please read FAQ181-2886 before posting.
 
IF / VLOOKUP / Whatever, my comment still hold good, so you need to put the formula in whatever cell you want the result returned to.

Regards
Ken...........

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]
----------------------------------------------------------------------------
 
many thanks - I have succeed in getting this lookup function to work.

=LOOKUP($C$2,RPeriod,Formula!$C$2:$C$17)

[smile]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top