#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Excel formula

I regularly use the formula =sum()-sum(). My question is how or can I create
a formula shortcut and to just fill in between the brackets to complete my
equation. I would like the shortcut to be readily available instead of always
having to retype it in. Can a shortcut be placed on a toolbar or within the
autofil shortcut on toolbar.
Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Excel formula

Once you type the =SUM( you are in edit mode so you cannot invoke the
shortcut at that point. You would have to writ e a macro to return the whole
formula.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"azarat" wrote in message
...
I regularly use the formula =sum()-sum(). My question is how or can I
create
a formula shortcut and to just fill in between the brackets to complete my
equation. I would like the shortcut to be readily available instead of
always
having to retype it in. Can a shortcut be placed on a toolbar or within
the
autofil shortcut on toolbar.
Thank you.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default Excel formula

Two alternatives
1) a UDF
Function diff(r1, r2)
For j = 1 To r1.Count
diff = diff + r1(j)
Next j
For j = 1 To r2.Count
diff = diff - r2(j)
Next j
End Function

call with =DIFF(B1:B5,A1:A5)
the two ranges need not be the same size

2) =SUMPRODUCT(r1-r2) as in =SUMPRODUCT(A1:A5-B1:B5)
the two ranges must be the same size
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"azarat" wrote in message
...
I regularly use the formula =sum()-sum(). My question is how or can I
create
a formula shortcut and to just fill in between the brackets to complete my
equation. I would like the shortcut to be readily available instead of
always
having to retype it in. Can a shortcut be placed on a toolbar or within
the
autofil shortcut on toolbar.
Thank you.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Excel formula

I wonder if there is any break-even point for the number of cells covered by
the ranges after which this UDF might become more efficient than the one you
proposed?

Function DIFF(R1 As Range, R2 As Range) As Double
DIFF = Application.WorksheetFunction.Sum(R1) - _
Application.WorksheetFunction.Sum(R2)
End Function

Rick


"Bernard Liengme" wrote in message
...
Two alternatives
1) a UDF
Function diff(r1, r2)
For j = 1 To r1.Count
diff = diff + r1(j)
Next j
For j = 1 To r2.Count
diff = diff - r2(j)
Next j
End Function

call with =DIFF(B1:B5,A1:A5)
the two ranges need not be the same size

2) =SUMPRODUCT(r1-r2) as in =SUMPRODUCT(A1:A5-B1:B5)
the two ranges must be the same size
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"azarat" wrote in message
...
I regularly use the formula =sum()-sum(). My question is how or can I
create
a formula shortcut and to just fill in between the brackets to complete
my
equation. I would like the shortcut to be readily available instead of
always
having to retype it in. Can a shortcut be placed on a toolbar or within
the
autofil shortcut on toolbar.
Thank you.




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 622
Default Excel formula

On Jun 29, 6:49 am, azarat wrote:
I regularly use the formula =sum()-sum(). My question is how or can I create
a formula shortcut and to just fill in between the brackets to complete my
equation. I would like the shortcut to be readily available instead of always
having to retype it in. Can a shortcut be placed on a toolbar or within the
autofil shortcut on toolbar.
Thank you.


Maybe you need a template file already set up with your formulas
instead of VBA code to constantly re-create them.
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
Excel 2002 Formula: Urgent Conditional Formula Required Right Away - if possible blue[_2_] Excel Discussion (Misc queries) 2 July 11th 07 06:08 PM
Build excel formula using field values as text in the formula val kilbane Excel Worksheet Functions 2 April 18th 07 01:52 PM
match formula - 2 excel files:#1 hasthis formula, 2nd has the Raw DS Excel Worksheet Functions 4 October 7th 06 12:25 AM
Excel 2002 formula displayed not value formula option not checked Dean Excel Worksheet Functions 1 February 28th 06 02:31 PM
i edit a formula (excel) then it displays formula not answer caiman Excel Discussion (Misc queries) 2 September 9th 05 02:09 AM


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