ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Sum and Index formula? (https://www.excelbanter.com/excel-discussion-misc-queries/20758-sum-index-formula.html)

Luke

Sum and Index formula?
 
I have the following index formula '=INDEX(PlanPax,A21,$B$4)' where cell B4
is the month number e.g. 3 for March. How could I amend the formula (and cell
B4) so that I sum January to March (or columns 1 to 3)?

Luke

Duke Carey

Without knowing some specifics about your layout I can't give you a formula
example, but assuming your columns are Jan, Feb, Mar, etc I'd use something
like

=SUM(OFFSET(top_left_corner of PlanPax, A21,B4-2,1,3))

Duke

"Luke" wrote:

I have the following index formula '=INDEX(PlanPax,A21,$B$4)' where cell B4
is the month number e.g. 3 for March. How could I amend the formula (and cell
B4) so that I sum January to March (or columns 1 to 3)?

Luke


P Sitaram

Assuming that you always need a three column offset, try:

=SUM(INDEX(PlanPax,A21,$B$4):INDEX(PlanPax,A21,$B$ 4+3)



All times are GMT +1. The time now is 03:58 AM.

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