Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
mijoh20
 
Posts: n/a
Default Sum Conditional Items by date across workbooks

Hello,

I have a workbook that contains 2 worksheets. Worksheet 1, called
Client Log contains a list of client names, the county where they
live, 2 different amount columns, and the date entered.

The second worksheet, called Billing Details needs to total the 2
amount columns in the Client Log into one column for the current
month, for the current year, and for life to date, by county.

Any assistance with this would be greatly appreciated...

  #2   Report Post  
Max
 
Posts: n/a
Default

Here's one set-up to try ..

Assume the sample data below is in sheet: Client Log
in B1:E8, data from row2 down

County Amt1 Amt2 Date
County1 419 381 01-Jan-04
County2 212 161 24-Jan-05
County1 339 331 02-Feb-05
County3 467 403 15-Feb-05
County3 499 204 23-Mar-05
County2 487 329 24-Mar-05
County1 123 131 25-Mar-05
etc

In an empty col to the right, say col G,

Put in G2: =IF(B2="","",IF(COUNTIF($B$2:B2,B2)1,"",ROW()))

Copy G2 down to say G1000 to cover the max expected data range
in cols B to E (can copy down ahead of expected data input)

In sheet: Billing Details
---------------------
Put in A1:D1 the 4 labels:
County, CurrMth, CurrYr, ToDate

Put:

in A2:
=IF(ISERROR(SMALL('Client Log'!$G:$G,ROWS($A$1:A1))),"",INDEX('Client
Log'!B:B,MATCH(SMALL('Client Log'!$G:$G,ROWS($A$1:A1)),'Client
Log'!$G:$G,0)))

in B2:
=IF(A2="","",SUMPRODUCT(('Client Log'!$B$2:$B$1000=A2)*(MONTH('Client
Log'!$E$2:$E$1000)=MONTH(TODAY())),('Client Log'!$C$2:$C$1000)+'Client
Log'!$D$2:$D$1000))

in C2:
=IF(A2="","",SUMPRODUCT(('Client Log'!$B$2:$B$1000=A2)*(YEAR('Client
Log'!$E$2:$E$1000)=YEAR(TODAY())),('Client Log'!$C$2:$C$1000)+'Client
Log'!$D$2:$D$1000))

in D2:
=IF(A2="","",SUMIF('Client Log'!B:B,A2,'Client Log'!C:C)+SUMIF('Client
Log'!B:B,A2,'Client Log'!D:D))

Select A2:D2, fill down to D1000
(cover the same range as in sheet: Client Log)

The above should return what you're after:

Col A will produce a list of the unique counties in Client Log

Col B will return the sum of the amounts from the 2 cols: Amt1 & Amt2 in
Client Log for the current month by county

Col C will return the sum of the amounts from the 2 cols: Amt1 & Amt2 in
Client Log for the current year by county

Col D will return the sum of the amounts from the 2 cols: Amt1 & Amt2 in
Client Log for "life to-date" by county, i.e. irrespective of the date
entered

For the sample data in Client Log,
you'll get in Billing Details:

County CurrMth CurrYr ToDate
County1 254 924 1724
County2 816 1189 1189
County3 703 1573 1573
(rest are blank [""] rows)

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"mijoh20" wrote in message
...
Hello,

I have a workbook that contains 2 worksheets. Worksheet 1, called
Client Log contains a list of client names, the county where they
live, 2 different amount columns, and the date entered.

The second worksheet, called Billing Details needs to total the 2
amount columns in the Client Log into one column for the current
month, for the current year, and for life to date, by county.

Any assistance with this would be greatly appreciated...



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
How do I set a date range for conditional formatting in a macro? billo Excel Worksheet Functions 3 February 7th 05 06:19 PM
Conditional formating w/ Date Steven Stadelhofer Excel Worksheet Functions 1 February 3rd 05 05:29 PM
Conditional Formatting (Date vs Number) [email protected] Excel Discussion (Misc queries) 7 December 20th 04 10:23 PM
Count items between specific hours on a matching date KS Excel Worksheet Functions 1 December 10th 04 05:52 PM
Addition to Turn cell red if today is greater or equal to date in cell Rich New Users to Excel 2 December 9th 04 02:06 AM


All times are GMT +1. The time now is 05:07 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"