Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Sum if formula

Help!. I have this sumif formula that calculates total
General items. I will like to extend this formula to show
the total of General items when it exceeds 50. I will
like for it to report on Column G. Example General Items
if 60. It should report as excess of 10 Items or
something like that. Is this possible? If yes, I will
appreciate any help.
This is the current formula:

c.Offset(6, 3).Formula = "=Sumif(" & rng1.Offset(0,
3).Address & _
","" General items ""," & rng1.Offset
(0, 4).Address & ")"

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Sum if formula

Paul,

Here's an example:

In a new worksheet, Put values from 1 to 10 in cells A1:A10
In another cell use this formula: =SUMIF(A1:A10,"<5",A1:A10)
1+2+3+4 = 10

Other criteria can be "<=5", "=17", etc...

There's a Conditional Sum Wizard Add-In which can help you out too.


Rob


"paul" wrote in message
...
Help!. I have this sumif formula that calculates total
General items. I will like to extend this formula to show
the total of General items when it exceeds 50. I will
like for it to report on Column G. Example General Items
if 60. It should report as excess of 10 Items or
something like that. Is this possible? If yes, I will
appreciate any help.
This is the current formula:

c.Offset(6, 3).Formula = "=Sumif(" & rng1.Offset(0,
3).Address & _
","" General items ""," & rng1.Offset
(0, 4).Address & ")"



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Sum if formula

Thanks Rob, but this is not what i am looking for. I need
the difference between the sumif of a column from the amt
50. Then a message box saying excess of 10. Also, this is
to modify a macro.
Thanks again
-----Original Message-----
Paul,

Here's an example:

In a new worksheet, Put values from 1 to 10 in cells

A1:A10
In another cell use this formula: =SUMIF

(A1:A10,"<5",A1:A10)
1+2+3+4 = 10

Other criteria can be "<=5", "=17", etc...

There's a Conditional Sum Wizard Add-In which can help

you out too.


Rob


"paul" wrote in message
...
Help!. I have this sumif formula that calculates total
General items. I will like to extend this formula to

show
the total of General items when it exceeds 50. I will
like for it to report on Column G. Example General

Items
if 60. It should report as excess of 10 Items or
something like that. Is this possible? If yes, I will
appreciate any help.
This is the current formula:

c.Offset(6, 3).Formula = "=Sumif(" & rng1.Offset(0,
3).Address & _
","" General items ""," & rng1.Offset
(0, 4).Address & ")"



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Sum if formula

How about a formula that looks like:

=if(sumif()50,sumif()-50,0)

But an equivalent (and easier to write):
=max(0,sumif()-50)

So your code could look like:

Option Explicit
Sub testme()

Dim c As Range
Dim Rng1 As Range

'test locations
Set c = ActiveSheet.Range("d9")
Set Rng1 = ActiveSheet.Range("e9:e55")

c.Offset(6, 3).Formula = "=max(0,Sumif(" & Rng1.Offset(0, 3).Address & _
","" General items ""," & Rng1.Offset(0, 4).Address & ")-50)"
End Sub


paul wrote:

Help!. I have this sumif formula that calculates total
General items. I will like to extend this formula to show
the total of General items when it exceeds 50. I will
like for it to report on Column G. Example General Items
if 60. It should report as excess of 10 Items or
something like that. Is this possible? If yes, I will
appreciate any help.
This is the current formula:

c.Offset(6, 3).Formula = "=Sumif(" & rng1.Offset(0,
3).Address & _
","" General items ""," & rng1.Offset
(0, 4).Address & ")"


--

Dave Peterson

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
Commenting custom formula fields/formula on formula editor Muxer Excel Programming 2 July 24th 03 01:02 AM


All times are GMT +1. The time now is 06:20 PM.

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"