Originally Posted by
daffodil11
Sure. The purpose of $ is to create absolute references.
If I type = A1 in cell B1, and then copy that formula into F20, the reference will adjust itself to E20.
If I put a $ in front of the row =A$1, it will make the row as an absolute reference, but leave the column relative, so that copied to F20, it will say =E$1.
If I reverse it and copied to F20, only the row will adjust but the column becomes absolute. So =$A1 copied out to F20 will now say =$A20.
In my formula, I wrote D2 first. I like being efficient, so I write absolute references only where needed so when I copy D2 into E6, for example, I want it to still target what's relevant. It need to target the date in the header, and it needs to always target that first line, so
=IF(YEAR(D1)&MONTH(D1)=YEAR(B2)&MONTH(B2),C2,"")
becomes
=IF(YEAR(D$1)&MONTH(D$1)=YEAR(B2)&MONTH(B2),C2,"") so that wherever I copy to, it's still referring to the top line, but allowing the header column to adjust itself.
I always need the Invoice Data to stay absolute in relation to that column, but I want it to adjust as I copy down.
=IF(YEAR(D$1)&MONTH(D$1)=YEAR(B2)&MONTH(B2),C2,"")
becomes
=IF(YEAR(D$1)&MONTH(D$1)=YEAR($B2)&MONTH($B2),C2,"")
Lastly, I also want the invoice amount to change depending on the row I'm on, so we make it's column an absolute value
=IF(YEAR(D$1)&MONTH(D$1)=YEAR($B2)&MONTH($B2),C2,"")
becomes
=IF(YEAR(D$1)&MONTH(D$1)=YEAR($B2)&MONTH($B2),$C2,"")
Now when I copy D2
=IF(YEAR(D$1)&MONTH(D$1)=YEAR($B2)&MONTH($B2),$C2,"")
into E6, only the relative references adjust themselves, becoming:
=IF(YEAR(E$1)&MONTH(E$1)=YEAR($B6)&MONTH($B6),$C6,"") so that the header, invoice amount, and bil date are retargeted but without changing row or column as appropriate.
Ultimately, it comes down to programming a single cell well enough that its formula can be applied to all other cells and what its pointing to will automatically adjust. Otherwise, you're left writing a different formula for every cell.
Bookmarks