Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / February 2008

Tip: Looking for answers? Try searching our database.

Using variables as parameters of function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
R - 09 Feb 2008 16:30 GMT
Hi guys,

I got a little problem with my Excel function and cannot solve the
following:

Let's say

A1 shows "D1". D1 contains 10.
A2 shows "D2". D2 contains 5.

Now I am trying to get Excel sum these two - like SUM (%A1:%A2).
I know "%" are incorrect here but I am trying to stress that A1 and A2 are
not fixed parameters of the SUM function but only variables (they should
read A1 which links to D1 and get the value of D1 which is 10)

How do I do the function then?

Of course, when I go SUM (A1:A2) now, it gives me 0.
I believe there is an operator to show Excel that both A1 and A2 are the
variables.

THANKS A LOT for your help.

R.
Ron Coderre - 09 Feb 2008 16:34 GMT
Try this:

=SUM(INDIRECT(A1&":"&A2))

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

> Hi guys,
>
[quoted text clipped - 20 lines]
>
> R.
R - 10 Feb 2008 10:13 GMT
Oh yes, thanks a looooot! :)

R.

> Try this:
>
[quoted text clipped - 33 lines]
>>
>> R.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.