# Sumifs across relative numbers of columns based on cell value.

1. ## Sumifs across relative numbers of columns based on cell value.

So I'm working with a forecast for individual items. I need a way to enter a number into a cell (named 'timeframe'), and for the sum of a list of items to populate based on the 'timeframe' number of weeks (column).

Each column is a week of data, and if 8 week is selected from a data validation, I need the first 8 columns to be sumif'd based on item numbers.

I'm fairly sure it's going to involve some combo index / sumifs, and would like it to be fairly flexible to allow new items and columns to be added..

Appreciate anyone who can help me with this.

2. ## Re: Sumifs across relative numbers of columns based on cell value.

So you want to sum from "Week 1" forward (based on the value in B1? and not to sum backwards from the last week (Week 15)?

3. ## Re: Sumifs across relative numbers of columns based on cell value.

Correct!

A sum of demand by item, based on the amount of weeks I want to look at.

4. ## Re: Sumifs across relative numbers of columns based on cell value.

Worksheet "dash"

B4=SUMPRODUCT((fcst!\$A\$2:\$A\$40=A4)*(fcst!\$B\$1:\$P\$1="Week "&\$B\$1)*(fcst!\$B\$2:\$P\$40)) copydown

5. ## Re: Sumifs across relative numbers of columns based on cell value.

In B4, try
Formula:
`Please Login or Register  to view this content.`

This assumes that weeks start from 1 and increment by 1, not skipping any. If that's not the case, I can modify.

#### Thread Information

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1