How do I keep one part of a formula constant?

E

Ed S

I am looking to find the numbers of days between two dates. G2 will have the
current date and there will be multiple entries in column E.

I know how to find the number of days, G2-E4 gives me what I want but when I
copy the formula to get G2-E5 it changes G2 to G3.

How do I keep the G2 portion constant?

Thanks to all in advance.
 
A

AltaEgo

You need to change your formula from relative reference to G2 to absolute
reference. To do this, you simply need to add a $ symbol before the position
in the cell reference that you wish to remain unchanged when copied. Your
formula below becomes:

=G$2-E5

When you copy the above down one row is becomes =G$2-E6.

Read more here:

http://www.techonthenet.com/excel/questions/referencing.php


ALTERNATIVELY

You could name cell G2 and use this in your formula. Let's say you call G2
fixedDate, your formula becomes

=fixedDate-E5

When copied down this becomes =fixedDate-E6

Instructions on naming cells:
http://www.computerhope.com/issues/ch000704.htm
 
E

Ed S

Thank you for the prompt replies.

AltaEgo said:
You need to change your formula from relative reference to G2 to absolute
reference. To do this, you simply need to add a $ symbol before the
position in the cell reference that you wish to remain unchanged when
copied. Your formula below becomes:

=G$2-E5

When you copy the above down one row is becomes =G$2-E6.

Read more here:

http://www.techonthenet.com/excel/questions/referencing.php


ALTERNATIVELY

You could name cell G2 and use this in your formula. Let's say you call G2
fixedDate, your formula becomes

=fixedDate-E5

When copied down this becomes =fixedDate-E6

Instructions on naming cells:
http://www.computerhope.com/issues/ch000704.htm
 

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