Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10
Default passing dates in a conditional sum(if)

I have a workbook with 5 sheets.
Sheet1 is Customers
Sheet2 is YTD Sales 07
Sheet3 is Total Sales 06
Sheet4 is Total Sales 05
Sheet5 is Total Sales 04

Customer sheet has this basic formula in the columns for each year's sales
based on the customer's number and the variable of the month that the sales
was done. {=SUM(IF((Custnumber07=A3)*(Month07<=$J$1),amount0 7))}

The problem is that the accounting program exports the invoices with the
MMDDYY for each invoice. The $j$1 is the number of the month I limit it up
to. I have a column in each sales sheet with the month() function to pull
the month out. This works ok but it always pulls the entire months from the
completed years and present year's sales always look behind. Completed
months give good info but to run the report in mid month is deceiving.
I want to be able to put a variable date range in the sum(if) array and have
run into a brickwall. I have tried using the Date(,month(),day())with no
luck. I think I have to use it because the years are different.
I think that the formula should read something like "if the customer number
is the same and the invoice date is <= $j$1 then sum invoice amount". J1 is
the date as 3/15/07 and date07 is the range where it takes the invoice date
and strips it of the year using date(,month(e2),day(e2)) so that the date
reads 3/15 not 3/15/07 or 3/15/06...
{=SUM(IF((Custnumber07=A5)*(date07<=DATE(,MONTH($J $1),DAY($J$1))),amount07))}
and get #N/A
Any help or guidance is greatly appreciated. I have searched on Chip
Pearson's, Microsoft's and others websites with no luck.
Thanks,
Lee Coleman


  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10,593
Default passing dates in a conditional sum(if)

Maybe this

=SUMPRODUCT(--(Custnumber07=A3),--(date07<=DATE(YEAR(date07),MONTH($J$1),DAY($J$1))) ,amount07)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Neophyte" wrote in message
...
I have a workbook with 5 sheets.
Sheet1 is Customers
Sheet2 is YTD Sales 07
Sheet3 is Total Sales 06
Sheet4 is Total Sales 05
Sheet5 is Total Sales 04

Customer sheet has this basic formula in the columns for each year's sales
based on the customer's number and the variable of the month that the
sales was done. {=SUM(IF((Custnumber07=A3)*(Month07<=$J$1),amount0 7))}

The problem is that the accounting program exports the invoices with the
MMDDYY for each invoice. The $j$1 is the number of the month I limit it up
to. I have a column in each sales sheet with the month() function to pull
the month out. This works ok but it always pulls the entire months from
the completed years and present year's sales always look behind. Completed
months give good info but to run the report in mid month is deceiving.
I want to be able to put a variable date range in the sum(if) array and
have run into a brickwall. I have tried using the Date(,month(),day())with
no luck. I think I have to use it because the years are different.
I think that the formula should read something like "if the customer
number is the same and the invoice date is <= $j$1 then sum invoice
amount". J1 is the date as 3/15/07 and date07 is the range where it takes
the invoice date and strips it of the year using date(,month(e2),day(e2))
so that the date reads 3/15 not 3/15/07 or 3/15/06...
{=SUM(IF((Custnumber07=A5)*(date07<=DATE(,MONTH($J $1),DAY($J$1))),amount07))}
and get #N/A
Any help or guidance is greatly appreciated. I have searched on Chip
Pearson's, Microsoft's and others websites with no luck.
Thanks,
Lee Coleman



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 10
Default passing dates in a conditional sum(if)

Thanks for the response. The ranges of Customer07 are not the same as Date07
and Amount07(they are =). If I make all the named ranges the same number of
rows(10205 is the largest worksheet) and some are blank, will this mess up
sumproduct? Or do they have to be the same range?
I think I read that they had to be the same for sumproduct and that is why I
chose sum(if) as I never could get sumproduct to work.
What does the -- mean?
When I enter sumproduct in the cell I get a #value! error.

Thanks,
Lee Coleman

"Bob Phillips" wrote in message
...
Maybe this

=SUMPRODUCT(--(Custnumber07=A3),--(date07<=DATE(YEAR(date07),MONTH($J$1),DAY($J$1))) ,amount07)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Neophyte" wrote in message
...
I have a workbook with 5 sheets.
Sheet1 is Customers
Sheet2 is YTD Sales 07
Sheet3 is Total Sales 06
Sheet4 is Total Sales 05
Sheet5 is Total Sales 04

Customer sheet has this basic formula in the columns for each year's
sales based on the customer's number and the variable of the month that
the sales was done.
{=SUM(IF((Custnumber07=A3)*(Month07<=$J$1),amount0 7))}

The problem is that the accounting program exports the invoices with the
MMDDYY for each invoice. The $j$1 is the number of the month I limit it
up to. I have a column in each sales sheet with the month() function to
pull the month out. This works ok but it always pulls the entire months
from the completed years and present year's sales always look behind.
Completed months give good info but to run the report in mid month is
deceiving.
I want to be able to put a variable date range in the sum(if) array and
have run into a brickwall. I have tried using the
Date(,month(),day())with no luck. I think I have to use it because the
years are different.
I think that the formula should read something like "if the customer
number is the same and the invoice date is <= $j$1 then sum invoice
amount". J1 is the date as 3/15/07 and date07 is the range where it takes
the invoice date and strips it of the year using date(,month(e2),day(e2))
so that the date reads 3/15 not 3/15/07 or 3/15/06...
{=SUM(IF((Custnumber07=A5)*(date07<=DATE(,MONTH($J $1),DAY($J$1))),amount07))}
and get #N/A
Any help or guidance is greatly appreciated. I have searched on Chip
Pearson's, Microsoft's and others websites with no luck.
Thanks,
Lee Coleman





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
Passing a row to a function dch3 Excel Worksheet Functions 2 July 31st 06 12:34 PM
Passing a UDF as an argument to a UDF puff Excel Discussion (Misc queries) 3 February 23rd 06 09:46 PM
Passing Variables Jeff Excel Discussion (Misc queries) 1 November 4th 05 06:46 PM
Conditional Formatting & Dates? Nat Excel Discussion (Misc queries) 5 August 10th 05 10:26 AM
Conditional Formatting w/ Dates John F.M. Excel Discussion (Misc queries) 5 May 31st 05 03:18 PM


All times are GMT +1. The time now is 09:47 PM.

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

About Us

"It's about Microsoft Excel"