using named ranges for formula abbreviations

D

Dave Breitenbach

I would like to use named ranegs, if possible, to replace the function
SUMPRODUCT with the abbreviated nam "SP." I created the named range SP and
called it sumproduct, but I have not been able to make it work.

this function
=SP&"(--($H$4:$H$21=J5),--($F$4:)$F$21))"
gives me as a result
sumproduct(--($H$4:$H$21=J5),--($F$4:)$F$21))
but does niot give me the result of that formula.

any help would be greatly appreciated.

Dave
 
B

Bob Phillips

It ain't gonna happen. You could create a UDF called SP that invokes
SUMPRODUCT, but why would you bother.

--
---
HTH

Bob

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

vezerid

Although I seriously doubt the eventual utility of this approach, here
is a UDF that is a shorthand for SUMPRODUCT:

Function SP(args As String)
SP = Evaluate("SUMPRODUCT(" & args & ")")
End Function

It can be called by entering the arguments as a string e.g.

=SP("--($H$4:$H$21=J5),--($F$4:)$F$21)")

As you notice we have a single Text argument, which contains what
would otherwise be your argument list.

HTH
Kostis Vezerides
 
D

Dave Breitenbach

The intent was to avoid character limitations in a particular cell. But I'd
rather not use VB.

thanks anyway.

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top