Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Excel "IF()" Statement Help????

---------------------------------------------------------------

I am developing a spread sheet that needs to display the data /
contents of one cell in another cell only if the following conditions
are true / have been met.

Example:

Cell A1 contains a purchase date (i.e. 11-12-2003)

Cell B1 contains a purchase price (i.e. $40.00)

In addition to the above columns (purchase date & purchase price) I
have 12 columns labeled Jan 03 - Dec 03 for the months of the year.

I want to create an "IF()" statement that will disply the purchase
price in the correct month column and a "0" in the rest of the columns
based on the following conditions:

Condition A: IF(MONTH(A1=X))

and

Condition B: IF(YEAR(A1=Y))

I have tried the following functions, but they always display the
purchase price no matter what date has been entered.

1.) =IF(AND(MONTH(A1=X),YEAR(A1=Y)),B1,0)
2.) =IF(MONTH(A1=X),B1,IF(YEAR(A1=Y),B1,0))

Any assistance provided will be greatly appreciated, and thank you in
advance to all that may offer assistance.

---------------------------------------------------------------
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Excel "IF()" Statement Help????

This is basicly a nested if statement, where :
A2 = purchase date,
B2 = purchase price,
D1 to O1 contained reference date (Jan-03 to Dec - 03)
----------------------------------------------------------------------------
----------------
Formula for D2 is : =IF(MONTH(A2)=MONTH(D1),IF(YEAR(A2)=YEAR(D1),B2,0) ,0)
----------------------------------------------------------------------------
-----------------
Then just fill across and down, minding cell adresses as you go

Good Luck,
Tumbleweed

"WebWizard97" wrote in message
m...
---------------------------------------------------------------

I am developing a spread sheet that needs to display the data /
contents of one cell in another cell only if the following conditions
are true / have been met.

Example:

Cell A1 contains a purchase date (i.e. 11-12-2003)

Cell B1 contains a purchase price (i.e. $40.00)

In addition to the above columns (purchase date & purchase price) I
have 12 columns labeled Jan 03 - Dec 03 for the months of the year.

I want to create an "IF()" statement that will disply the purchase
price in the correct month column and a "0" in the rest of the columns
based on the following conditions:

Condition A: IF(MONTH(A1=X))

and

Condition B: IF(YEAR(A1=Y))

I have tried the following functions, but they always display the
purchase price no matter what date has been entered.

1.) =IF(AND(MONTH(A1=X),YEAR(A1=Y)),B1,0)
2.) =IF(MONTH(A1=X),B1,IF(YEAR(A1=Y),B1,0))

Any assistance provided will be greatly appreciated, and thank you in
advance to all that may offer assistance.

---------------------------------------------------------------



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Excel "IF()" Statement Help????

I just wanted to say thank you to Tumbleweed, Tom and Ken for your
assistance with my little IF() problem all of your suggestions and
tips work exactly like I wanted them too.

Thanks again for your help.


WebWizard97
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining "IF"statement with "Vlookup" Malcolm McMaster[_2_] Excel Discussion (Misc queries) 9 October 21st 14 03:13 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
embedding "ISERROR" function into an "IF" statement [email protected] Excel Worksheet Functions 8 January 4th 07 12:01 AM
"IF" statement & "strikethrough" formatting jijy Excel Worksheet Functions 3 March 22nd 06 06:56 PM


All times are GMT +1. The time now is 10:23 PM.

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

About Us

"It's about Microsoft Excel"