Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default vba and conditional totalling ... WorksheetFunction SumIf ?

I am not sure if SumIf is the correct function to use ....

I have a worksheet containing the following

Column A = Date
Column D = Amount (+ve and -ve values to represent Debits and Credits)
Column F = Status ("Cleared" or "Not Cleared")

I would like to display, on a userform, various totals e.g.

Between a range of values in column A, the sum of negative values in Column
D that have the status "Cleared" in Column F.

If you could let me have the code for this calculation, hopefully, I can
edit it to produce similar sub totals

Regards and TIA


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default vba and conditional totalling ... WorksheetFunction SumIf ?

=SUMPRODUCT(--(A2:A100=--"2005-06-01"),--(A2:A100<=--"2005-06-30"), --(F2:F
100="Cleared"),D2:D100)

which gives total amount for Cleared items in June.

To do this in VBA, use

myTot =
evaluate("SUMPRODUCT(--(A2:A100=--""2005-06-01""),--(A2:A100<=--""2005-06-3
0""), --(F2:F100=""Cleared""),D2:D100)")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"SA3214 @Eclipse.co.uk" <sa3214<No Spam wrote in message
...
I am not sure if SumIf is the correct function to use ....

I have a worksheet containing the following

Column A = Date
Column D = Amount (+ve and -ve values to represent Debits and Credits)
Column F = Status ("Cleared" or "Not Cleared")

I would like to display, on a userform, various totals e.g.

Between a range of values in column A, the sum of negative values in

Column
D that have the status "Cleared" in Column F.

If you could let me have the code for this calculation, hopefully, I can
edit it to produce similar sub totals

Regards and TIA




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default vba and conditional totalling ... WorksheetFunction SumIf ?

Bob,
Many thanks for the swift response,
What you suggested is a start .... but it evaluates the total of all cleared
payments (both +ve and -ve).
Would you mind editing it to produce the sum of either +ve or -ve ... I'm
not sure I am upto it.

Regards
.....................................

"Bob Phillips" wrote in message
...
=SUMPRODUCT(--(A2:A100=--"2005-06-01"),--(A2:A100<=--"2005-06-30"), --(F2:F
100="Cleared"),D2:D100)

which gives total amount for Cleared items in June.

To do this in VBA, use

myTot =
evaluate("SUMPRODUCT(--(A2:A100=--""2005-06-01""),--(A2:A100<=--""2005-06-3
0""), --(F2:F100=""Cleared""),D2:D100)")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"SA3214 @Eclipse.co.uk" <sa3214<No Spam wrote in message
...
I am not sure if SumIf is the correct function to use ....

I have a worksheet containing the following

Column A = Date
Column D = Amount (+ve and -ve values to represent Debits and Credits)
Column F = Status ("Cleared" or "Not Cleared")

I would like to display, on a userform, various totals e.g.

Between a range of values in column A, the sum of negative values in

Column
D that have the status "Cleared" in Column F.

If you could let me have the code for this calculation, hopefully, I can
edit it to produce similar sub totals

Regards and TIA






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default vba and conditional totalling ... WorksheetFunction SumIf ?

=SUMPRODUCT(--(A2:A100=--"2005-06-01"),--(A2:A100<=--"2005-06-30"), --(F2:F
100="Cleared"),--(D2:D1000),D2:D100)

myTot =
evaluate("SUMPRODUCT(--(A2:A100=--""2005-06-01""),--(A2:A100<=--""2005-06-3
0""), --(F2:F100=""Cleared""),--(""D2:D100""0),D2:D100)")

I'll leave negative numbers for you


--

HTH

RP
(remove nothere from the email address if mailing direct)


"SA3214 @Eclipse.co.uk" <sa3214<No Spam wrote in message
...
Bob,
Many thanks for the swift response,
What you suggested is a start .... but it evaluates the total of all

cleared
payments (both +ve and -ve).
Would you mind editing it to produce the sum of either +ve or -ve ... I'm
not sure I am upto it.

Regards
....................................



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default vba and conditional totalling ... WorksheetFunction SumIf ?

Thanks Bob ...That is just what I needed and although I cannot fully
comprehend the syntax I did find a small error which I corrected
i.e. I removed the double quotes from .... (""D2:D100""0)

Many thanks ...... what a tremendous resource the newsgroup is



"Bob Phillips" wrote in message
...
=SUMPRODUCT(--(A2:A100=--"2005-06-01"),--(A2:A100<=--"2005-06-30"), --(F2:F
100="Cleared"),--(D2:D1000),D2:D100)

myTot =
evaluate("SUMPRODUCT(--(A2:A100=--""2005-06-01""),--(A2:A100<=--""2005-06-3
0""), --(F2:F100=""Cleared""),--(""D2:D100""0),D2:D100)")

I'll leave negative numbers for you


--

HTH

RP
(remove nothere from the email address if mailing direct)


"SA3214 @Eclipse.co.uk" <sa3214<No Spam wrote in message
...
Bob,
Many thanks for the swift response,
What you suggested is a start .... but it evaluates the total of all

cleared
payments (both +ve and -ve).
Would you mind editing it to produce the sum of either +ve or -ve ... I'm
not sure I am upto it.

Regards
....................................







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default vba and conditional totalling ... WorksheetFunction SumIf ?

Mea culpa! Well spotted.

Bob


"SA3214 @Eclipse.co.uk" <sa3214<No Spam wrote in message
...
Thanks Bob ...That is just what I needed and although I cannot fully
comprehend the syntax I did find a small error which I corrected
i.e. I removed the double quotes from .... (""D2:D100""0)

Many thanks ...... what a tremendous resource the newsgroup is



"Bob Phillips" wrote in message
...

=SUMPRODUCT(--(A2:A100=--"2005-06-01"),--(A2:A100<=--"2005-06-30"), --(F2:F
100="Cleared"),--(D2:D1000),D2:D100)

myTot =

evaluate("SUMPRODUCT(--(A2:A100=--""2005-06-01""),--(A2:A100<=--""2005-06-3
0""), --(F2:F100=""Cleared""),--(""D2:D100""0),D2:D100)")

I'll leave negative numbers for you


--

HTH

RP
(remove nothere from the email address if mailing direct)


"SA3214 @Eclipse.co.uk" <sa3214<No Spam wrote in message
...
Bob,
Many thanks for the swift response,
What you suggested is a start .... but it evaluates the total of all

cleared
payments (both +ve and -ve).
Would you mind editing it to produce the sum of either +ve or -ve ...

I'm
not sure I am upto it.

Regards
....................................







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default vba and conditional totalling ... WorksheetFunction SumIf ?

hi,

the formula works with only 1 argument for the date - A2:A100=--"6/01/2005"
- i cant put in the second part.

could you please post the function as you have it again.

Thanks,

Alex

"SA3214 @Eclipse.co.uk" wrote:

Bob,
Many thanks for the swift response,
What you suggested is a start .... but it evaluates the total of all cleared
payments (both +ve and -ve).
Would you mind editing it to produce the sum of either +ve or -ve ... I'm
not sure I am upto it.

Regards
.....................................

"Bob Phillips" wrote in message
...
=SUMPRODUCT(--(A2:A100=--"2005-06-01"),--(A2:A100<=--"2005-06-30"), --(F2:F
100="Cleared"),D2:D100)

which gives total amount for Cleared items in June.

To do this in VBA, use

myTot =
evaluate("SUMPRODUCT(--(A2:A100=--""2005-06-01""),--(A2:A100<=--""2005-06-3
0""), --(F2:F100=""Cleared""),D2:D100)")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"SA3214 @Eclipse.co.uk" <sa3214<No Spam wrote in message
...
I am not sure if SumIf is the correct function to use ....

I have a worksheet containing the following

Column A = Date
Column D = Amount (+ve and -ve values to represent Debits and Credits)
Column F = Status ("Cleared" or "Not Cleared")

I would like to display, on a userform, various totals e.g.

Between a range of values in column A, the sum of negative values in

Column
D that have the status "Cleared" in Column F.

If you could let me have the code for this calculation, hopefully, I can
edit it to produce similar sub totals

Regards and TIA







  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default vba and conditional totalling ... WorksheetFunction SumIf ?

Alex ... this problem was resolved in the later threads entitled:
'Ping ... Bob Philips' started on 17/06/2005
'Ping Bernie (or any other sage)' started on 18/06/2005

Regards
Jim Burton (aka Jimbo and SA3214)
--------------------------------------------------[

"alex" wrote in message
...
hi,

the formula works with only 1 argument for the date -
A2:A100=--"6/01/2005"
- i cant put in the second part.

could you please post the function as you have it again.

Thanks,

Alex

"SA3214 @Eclipse.co.uk" wrote:

Bob,
Many thanks for the swift response,
What you suggested is a start .... but it evaluates the total of all
cleared
payments (both +ve and -ve).
Would you mind editing it to produce the sum of either +ve or -ve ... I'm
not sure I am upto it.

Regards
.....................................

"Bob Phillips" wrote in message
...
=SUMPRODUCT(--(A2:A100=--"2005-06-01"),--(A2:A100<=--"2005-06-30"), --(F2:F
100="Cleared"),D2:D100)

which gives total amount for Cleared items in June.

To do this in VBA, use

myTot =
evaluate("SUMPRODUCT(--(A2:A100=--""2005-06-01""),--(A2:A100<=--""2005-06-3
0""), --(F2:F100=""Cleared""),D2:D100)")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"SA3214 @Eclipse.co.uk" <sa3214<No Spam wrote in message
...
I am not sure if SumIf is the correct function to use ....

I have a worksheet containing the following

Column A = Date
Column D = Amount (+ve and -ve values to represent Debits and Credits)
Column F = Status ("Cleared" or "Not Cleared")

I would like to display, on a userform, various totals e.g.

Between a range of values in column A, the sum of negative values in
Column
D that have the status "Cleared" in Column F.

If you could let me have the code for this calculation, hopefully, I
can
edit it to produce similar sub totals

Regards and TIA









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
Conditional sumif? ewan7279 Excel Discussion (Misc queries) 5 June 8th 09 05:11 PM
Conditional sumif wilson@irco Excel Discussion (Misc queries) 3 March 7th 06 10:17 PM
Conditional SUMIF Curtis Excel Worksheet Functions 8 September 26th 05 09:50 PM
WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions? Etien[_2_] Excel Programming 3 January 13th 04 04:07 PM
WorksheetFunction.CountIf & Worksheet.SumIf with 2 conditions? Etien Excel Programming 0 January 12th 04 06:11 PM


All times are GMT +1. The time now is 09:40 AM.

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

About Us

"It's about Microsoft Excel"