LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
xlm xlm is offline
external usenet poster
 
Posts: 55
Default Sum values in a range conditional upon dates and an additional

I am a little late here. Since I have spend sometimes working on this,
try this alternative formula.

=SUMPRODUCT(($A$2:$A$11="chicken
soup")*($B$2:$B$11=--"2008-01-01")*($B$2:$B$11<=--"2008-04-08")*$C$2:$C$11)

However, this formula hard code the criterias which is unlike Biff's
HTH
--
If this posting was helpful, please click on the Yes button

Thank You

cheers,









"Jay59874" wrote:

Apologies, I think it may be more clear if I were to ask it as so:

Item Transaction Date Transaction Amount
chicken soup 1/31/2008 $112
chicken soup 2/7/2008 $144
chicken soup 7/7/2008 $65
Cheese 5/7/2008 $89
cheese 9/9/2008 $92

How would I write a formula that basically says please sum the transaction
amounts if the item is = chicken soup and the transaction date is greater
than or equal to1/1/08 and less than 4/1/08?

"Jay59874" wrote:

This is awesome and more than enough for date data manipulation, with the
correct formula how I would I write the array formula to add values from a
column if the data in column 1 is equal to my variable, while adding the date
range parameter based upon information in column two?

Sorry, I know this is a kind of annoying requests...

Jay

"Forgone" wrote:

Try this....

http://www.mrexcel.com/archive/Dates/31867.html

I've got a module that works out which which FiscalYear, FiscalMonth
FiscalQuater, FiscalPeriod based on a transaction date which I've
pasted below.




Option Explicit
Const FMonthStart = 7 ' Numeric value representing the first
month
' of the fiscal year.
Const FDayStart = 1 ' Numeric value representing the first
day of
' the fiscal year.
Const FYearOffset = -1 ' 0 means the fiscal year starts in the
' current calendar year.
' -1 means the fiscal year starts in the
' previous calendar year.


Function GetFiscalYear(ByVal x As Variant)
' Function to obtain the FiscalYear of any given date

If x < DateSerial(Year(x), FMonthStart, FDayStart) Then
GetFiscalYear = Year(x) - FYearOffset - 1
Else
GetFiscalYear = Year(x) - FYearOffset
End If
End Function
Function GetFiscalMonth(ByVal x As Variant)
' Function to obtain the month of the financial year of any given date

Dim m
m = Month(x) - FMonthStart + 1
If Day(x) < FDayStart Then m = m - 1
If m < 1 Then m = m + 12
GetFiscalMonth = m
End Function

Function GetFiscalQuarter(ByVal x As Variant) As String

' =CONCATENATE(IF(MONTH(A1)<=3,"Quarter 3",IF(MONTH(A1)<=6,"Quarter
4", _
' IF(MONTH(A1)<=9,"Quarter 1","Quarter 2")))& " FY"&YEAR(A1))
'
Dim m
m = Month(x)

Select Case m
Case 1 To 3
GetFiscalQuarter = "Q3"
Case 4 To 6
GetFiscalQuarter = "Q4"
Case 7 To 9
GetFiscalQuarter = "Q1"
Case 10 To 12
GetFiscalQuarter = "Q2"
End Select
End Function
Function GetFiscalPeriod(ByVal x As Variant)
' Function to obtain the FiscalYear of any given date
Dim FiscalYear As Integer

If x < DateSerial(Year(x), FMonthStart, FDayStart) Then
GetFiscalPeriod = Year(x) - 1 & "-" & Year(x)
Else
GetFiscalPeriod = Year(x) & "-" & Year(x) + 1
End If


End Function

 
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
Additional Help with range of cells [email protected] Excel Worksheet Functions 1 September 21st 07 03:37 PM
Conditional formatting - range of dates Annabelle Excel Discussion (Misc queries) 0 May 24th 06 03:52 PM
Conditional formatting - range of dates Annabelle Excel Discussion (Misc queries) 0 May 24th 06 03:52 PM
Conditional Formatting (Dates) Repost with additional data BigH Excel Discussion (Misc queries) 1 January 29th 06 10:18 PM
Find dates in a range; then sum values in that range by a criteria Anders Excel Discussion (Misc queries) 4 October 21st 05 03:41 PM


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