# Excel, fill/drag & copy horizontal data while referencing vertical data

I am working on the attached Excel file and trying to drag and fill a formula horizontally from vertical data.
The data to be filled is in Row 3
The data to reference is in column G55:G81

Any ideas?
Checks---Balance.xlsx
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

EngineerCommented:
Try this array formula

=SUM(IF(CELL("type",\$D\$55:\$D\$81)="v",(TEXT(\$D\$55:\$D\$81,"mmmm")=D5),0)*(0&\$G\$55:\$G\$81))-D2
0
Author Commented:
I'm not sure how that works. Can you explain it a bit please?
Do I paste this in cell E3 and drag across to P3?  If so that does not work.
0
EngineerCommented:
This is an ARRAY formula. Do you know how to enter an array formula?
0
Mechanical EngineerCommented:
I changed row 5 to be the first of each month, formatted using Custom format mmmm. I entered 10/1/2013 in cell D5 and 11/1/2013 in E5. I then selected D5:E5 and dragged the little square at bottom right of selection marquee across to put the first of the month in each succeeding cell. Excel was smart enough to figure out the pattern.

This then allowed me to use a fairly easy to understand formula in cell D3. I copied that formula across to cell P3.
=SUMIFS(\$G55:\$G81,\$D55:\$D81,">=" & D5,\$D55:\$D81,"<=" & EOMONTH(D5,0))-D2

EOMONTH returns the last day of the month. The SUMIFS is then adding up column G as long as the date in column D is between the first and last days of the month. I needed two criteria for the dates: one for >= the first of the month, and the other for <= the last of the month.
Checks---BalanceQ28270097.xlsx
0

Experts Exchange Solution brought to you by