ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Index Row (https://www.excelbanter.com/excel-worksheet-functions/61246-index-row.html)

Lmbank

Index Row
 

In the following, I am summing a horizontal range that changes or gets
extended each month. The formula looks at this month's date and then
matches it to the correct column. Then it sums the row from the
beginning date to through the new month.

If I use the index formula as it is here, it does not increment the row
when it gets copied down the sheet:

=IF(A35<=$O$3,+N35-SUM(U35:INDEX($U$4:BP172,1,MATCH($O$3,$U$4:BP$4,1) ,1)),0)

If I add Row(), it doesn't return the correct answer.

If I add Row(##), it works only if I start the numbering 3 rows before
the actual row used.

=IF(A35<=$O$3,+N35-SUM(U35:INDEX($U$4:BP172,ROW(P32),MATCH($O$3,$U$4: BP$4,1),1)),0)

In this last formula, the row is actually row 35, but I used row 32 and
got the correct answer.

Anyone know what's going on here or a better way to sum a horizontal
range that changes each month? Thanks.


--
Lmbank
------------------------------------------------------------------------
Lmbank's Profile: http://www.excelforum.com/member.php...o&userid=29782
View this thread: http://www.excelforum.com/showthread...hreadid=494905



All times are GMT +1. The time now is 10:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com