LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
unofarmbob
 
Posts: n/a
Default Trying to total payments for months, need help with my function

I'm working with a spreadsheet that keeps track of checks written to
customers, and need to be able to total the payments for each month. The
spreadsheet begins in Nov, 04, and will continue to grow into the future, so
I'm trying to create a total for each month of each year. I've created a
function to check the date because there are text values within the data that
give errors when I try and run the MONTH and YEAR functions in Excel 2003.
So, I created this function:

Function MonthTotal(MonthNeeded, YearNeeded, VisitDate, Amount)

If VisitDate = "Last Visit Date" Then
MonthTotal = 0
Else
If Month(VisitDate) = MonthNeeded Then
If Year(VisitDate) = YearNeeded Then
MonthTotal = Amount
Else: MonthTotal = 0
End If
Else: MonthTotal = 0
End If
End If

End Function

The function works to check a single data point, but I'm having trouble
using it now to sum up the totals for the month. I thought about trying to
create another funtion that runs a loop through all the data that then calls
this function and keeps a running total, but I'm not very familiar with VB
and don't know the process. Any help as to what I should do would be great.
Thanks a lot!
 
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
using an IF function for a total Drummy Excel Discussion (Misc queries) 4 June 3rd 06 10:39 AM
Creating a Custom Excel Function to Calculate Gini Coefficients [email protected] Excel Worksheet Functions 3 February 21st 06 10:15 PM
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM
clock Wildman Excel Worksheet Functions 2 April 26th 05 10:31 AM
Whats the function to count the total times a word is displayed Monk Excel Discussion (Misc queries) 3 December 10th 04 10:39 PM


All times are GMT +1. The time now is 12:11 AM.

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"