View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
MrAcquire MrAcquire is offline
external usenet poster
 
Posts: 62
Default Copying Formulas From One Column To Another??

What I think you're asking is how to keep formulas references either relative
or absolute as needed as you copy from one cell to another. Using a dollar
sign ($) in the formula will keep the reference absolute, otherwise
references are relative. Here's a simple example of one way to accomplish
your task.

A B C
1 Denise Ryan
2 A 40 33
3 B 34 13
4 X 12 13
5 C 6 5
6 D 83 81
7 X 24 14
8
9 X 36 27

If A1:C7 is your database and you want a sum of Denise's widgets that have a
value of X in column A, enter the following formula in B9:

=SUMPRODUCT(($A9=$A$2:$A$7)*(B2:B7))

Then copy B9 to C9. When you do, C9 will show the correct relative and
absolute references.

=SUMPRODUCT(($A8=$A$2:$A$7)*(C2:C7))

SUMPRODUCT is a very useful function because it enables you to do more
complex queries than the simple example above. Learning about relative
versus absolute references is a critically important concept whenever you
copy formulas, regardless of what function you're using. Hope this helps.

"Leslie M" wrote:

I am setting up a worksheet to count the same data range but for various
people. Example
I am using the SUMPRODUCT function to add C1:C100 IF D1:D100=DENISE AND
C1:C100=X.
I would like to use the exact same data range but add for RYAN instead of
Denise. I have Ryan set up in his own column but when I copy and paste the
formula from Denise's column, it moves the ranges; C1:C100 becomes C2:C101
AND D1:D100 becomes E1:E100 or something similar to that... it varies
sometimes and I'm sure it's because of how I am copying, etc.

Any help would be greatly appreciated as it's getting to be more trouble
than it's worth to go in and change each formula for each cell.

Thanks!