SOLVED

Formula to automatically move to a new column based on date.

Copper Contributor

Hello everyone, attached is an example of the data I'm working with. 

 

What I'm having trouble figuring out is a formula that will move over automatically as the date changes with the =TODAY().

 

I currently use =SUMIF() to provide a total of the range under the date. But I need to shift over the formula's criteria references every day. This formula will help with other parts of some work as well and would go a much longer well.

 

NameCategory10/1/202010/2/202010/3/202010/4/202010/5/202010/6/202010/7/202010/8/202010/9/202010/10/2020
BlackDark50344320221502380



Thank you,

7 Replies

@RobG92 

Can you explain in detail what you actually want to do?

@Hans Vogelaar 

 

If I have Today() on A1, it produces today's current date.

In a table, I have a set of data with dates as headers and numeric data under each date.

 

I need help figuring out an appropriate formula to automatically sum data based on the date in the header. And that the date in the header needs to match the date in A1 ("TODAY()").

 

I was using a SUMIF Formula to Sum based on other criteria, but I have to adjust range being referenced in the data to reflect the data in the column under the present day represented in the header. 

 

Hope that makes sense.

@RobG92 

Thanks. Use:

 

=SUM(INDEX(C5:L10,0,MATCH(A1,C4:L4,0)))

@RobG92 

Alternatively:

 

=SUMPRODUCT((C4:L4=A1)*C5:L10)

@RobG92 

Hi there,

I think you should follow the following formula:

 

=SUM(FILTER($C$4:$L$10,$C$4:$L$4=$P$3)*(($B$4:$B$10=O4)))

=SUM(FILTER($C$4:$L$10,$C$4:$L$4=$P$3)*(($B$4:$B$10=O5)))

My solution file is attached to this message.

Good luck.

 

 

@Hans Vogelaar 

 

I like this formula, how would I modify this formula for a third and fourth category to sort?

Example from the sheet attached.

I have another set of data where, out of the sum collected with your formula, I need the singular sum total of items that correspond to a certain language and/or type. Which is why I used SumIF

 

best response confirmed by RobG92 (Copper Contributor)
Solution

@RobG92 

For example for US on the specified date:

 

=SUMPRODUCT(B4:C10*(B3:C3=A1)*(F4:F10="US"))

 

See the attached version.

1 best response

Accepted Solutions
best response confirmed by RobG92 (Copper Contributor)
Solution

@RobG92 

For example for US on the specified date:

 

=SUMPRODUCT(B4:C10*(B3:C3=A1)*(F4:F10="US"))

 

See the attached version.

View solution in original post