Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Calculating revenue over fiscal quarters

Assume your data is in columns A-F of Sheet1. In row 1, starting in
column H, put Q3FY07, Q4FY07, etc. Then the following macro will
generate the revenues by quarter and contract. If you want revenue by
client and quarter, you can use the worksheet function SUMIF below the
macro's output.

Sub RevByQtr()
Dim iRow As Integer
Dim iCol As Integer
Dim ws As Worksheet
Dim bFlag As Boolean
Set ws = Sheets("Sheet1")
iRow = 2
Do
iCol = 8
Do
If Left(ws.Cells(iRow, 3), 2) = Left(ws.Cells(1, iCol), 2) And _
Right(ws.Cells(iRow, 3), 2) = Right(ws.Cells(1, iCol), 2) Then
bFlag = True
For iCt = 1 To ws.Cells(iRow, 5) / 3
ws.Cells(iRow, iCol + iCt - 1) = ws.Cells(iRow, 6)
Next iCt
End If
iCol = iCol + 1
Loop Until bFlag = True
bFlag = False
iRow = iRow + 1
Loop Until ws.Cells(iRow, 2) = ""
End Sub

Hth,
Merjet


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
calculating revenue over months Nikhil Excel Worksheet Functions 0 June 19th 08 11:58 AM
Converting dates into their respective fiscal quarters Tan New Users to Excel 3 April 16th 07 07:46 PM
Help with a calculating revenue [email protected] Excel Discussion (Misc queries) 0 March 20th 07 01:13 AM
Fiscal quarters for two years... Ted McCastlain Excel Worksheet Functions 2 September 20th 06 02:08 PM
Formating Fiscal Quarters, rather than Months PatK Excel Discussion (Misc queries) 2 September 7th 05 05:08 AM


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