#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 367
Default If Statments

I need to write a formula that sum all the values in an amount field based on
the following criteria:

Line items that have a date greater than or equal to 1/1/2001 need to be
divided by .029.

Line items that have a date less than 1/1/2001 need to be divided by .03.

How would I go about writing this formula? Do I need to use and if statment?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 320
Default If Statments

Assuming the "line items" dates are in col A and the values are in B:
=SUMPRODUCT(--(A1:A29=DATEVALUE("1/1/2001")),B1:B29)/0.029+SUMPRODUCT(--(A1:A29<DATEVALUE("1/1/2001")),B1:B29)/0.03

"Jason" wrote:

I need to write a formula that sum all the values in an amount field based on
the following criteria:

Line items that have a date greater than or equal to 1/1/2001 need to be
divided by .029.

Line items that have a date less than 1/1/2001 need to be divided by .03.

How would I go about writing this formula? Do I need to use and if statment?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default If Statments

If the dates are in column A and the items are in column B, then in C1 enter:

=B1/IF(A1<DATE(2001,1,1),0.03,0.029) and copy down

In another cell enter:
=SUM(C:C)
--
Gary''s Student - gsnu200763


"Jason" wrote:

I need to write a formula that sum all the values in an amount field based on
the following criteria:

Line items that have a date greater than or equal to 1/1/2001 need to be
divided by .029.

Line items that have a date less than 1/1/2001 need to be divided by .03.

How would I go about writing this formula? Do I need to use and if statment?

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
under standing if statments zx12rbullet Excel Worksheet Functions 2 July 21st 07 10:16 PM
AND OR IF Statments Rogie Excel Worksheet Functions 3 February 12th 07 04:01 AM
IF statments and ranges Idz21 Excel Worksheet Functions 1 February 23rd 06 03:51 PM
If Statments containing letters Rick Wiley Excel Discussion (Misc queries) 2 November 9th 05 08:09 PM
Conditional statments. Paul987 Excel Discussion (Misc queries) 3 October 27th 05 09:25 PM


All times are GMT +1. The time now is 10:48 AM.

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"