Originally Posted by
dflak
Let's look at the formula: =IFERROR(IF(AND(MONTH($C4)=E$1,$C4<>""),$D4,""),"")
We'll pick it apart from the "inside out" which is the way excel executes things: AND(MONTH($C4)=E$1,$C4<>"") - first of all, I am using partial absolute referencing for the cells - $C4 means always use column C, but when you copy the formula down, the row can change. E$1 means always used row 1 but when you copy the formula across, the column changes. Something like $A$1 means always use cell A1 no matter where the formula is copied to.
So I did not want to type =IFERROR(IF(AND(MONTH($C4)=10,$C4<>""),$D4,""),"") in column E, =IFERROR(IF(AND(MONTH($C4)=11,$C4<>""),$D4,""),"") in column F, and so on. I put the 10, 11, 12, etc. on row 1 and arranged to have the formula look at that row. So with the dates ($C) and amounts ($D) locked by columns, and the month number ($1) locked by row, I only had to work out the formula in one cell. Then I could copy it to wherever I needed it. the unlocked parts of the row or columns in the formula are relative and change depending on where the formula is copied to.
Bookmarks