Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Changing range based on Date

I am counting cells with multiple criteria with the SUMPRODUCT function.

What I would like to do is have the function's 2nd range change as the
current date changes.

IE: If it is 1 Oct it will pull from column B, and then on 2 Oct it pulls
form column C and so on.

How can I change the 2nd range to match the column with the current day?



A B C D
1 | 1 Oct 2 Oct 3 Oct
2 | 7 X X
3 | 7 X
4 | 5 X X
5 | 5 X X X
6 | 5 X


# of 7 =SUMPRODUCT((A2:A6="7")*(B2:B6="X"))
# of 5 =SUMPRODUCT((A2:A6="5")*(B2:B6="X"))



  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Changing range based on Date

Try the below with the dates in row1. and the dates in excel/date format...

=SUMPRODUCT((A2:A6=7)*(INDIRECT(ADDRESS(2,MATCH(TO DAY(),1:1,0)) & ":" &
ADDRESS(6,MATCH(TODAY(),1:1,0)))="X"))

If this post helps click Yes
---------------
Jacob Skaria


"KeyloPapa" wrote:

I am counting cells with multiple criteria with the SUMPRODUCT function.

What I would like to do is have the function's 2nd range change as the
current date changes.

IE: If it is 1 Oct it will pull from column B, and then on 2 Oct it pulls
form column C and so on.

How can I change the 2nd range to match the column with the current day?



A B C D
1 | 1 Oct 2 Oct 3 Oct
2 | 7 X X
3 | 7 X
4 | 5 X X
5 | 5 X X X
6 | 5 X


# of 7 =SUMPRODUCT((A2:A6="7")*(B2:B6="X"))
# of 5 =SUMPRODUCT((A2:A6="5")*(B2:B6="X"))



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,718
Default Changing range based on Date

=SUMPRODUCT((A2:A6=7)*(B1:D1=TODAY())*(B2:D6="x"))


"KeyloPapa" wrote:

I am counting cells with multiple criteria with the SUMPRODUCT function.

What I would like to do is have the function's 2nd range change as the
current date changes.

IE: If it is 1 Oct it will pull from column B, and then on 2 Oct it pulls
form column C and so on.

How can I change the 2nd range to match the column with the current day?



A B C D
1 | 1 Oct 2 Oct 3 Oct
2 | 7 X X
3 | 7 X
4 | 5 X X
5 | 5 X X X
6 | 5 X


# of 7 =SUMPRODUCT((A2:A6="7")*(B2:B6="X"))
# of 5 =SUMPRODUCT((A2:A6="5")*(B2:B6="X"))



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Changing range based on Date

Try this:

=SUMPRODUCT(--(A2:A6=7),--(INDEX(B2:D6,,MATCH(TODAY(),B1:D1,0))="X"))

--
Biff
Microsoft Excel MVP


"KeyloPapa" wrote in message
...
I am counting cells with multiple criteria with the SUMPRODUCT function.

What I would like to do is have the function's 2nd range change as the
current date changes.

IE: If it is 1 Oct it will pull from column B, and then on 2 Oct it pulls
form column C and so on.

How can I change the 2nd range to match the column with the current day?



A B C D
1 | 1 Oct 2 Oct 3 Oct
2 | 7 X X
3 | 7 X
4 | 5 X X
5 | 5 X X X
6 | 5 X


# of 7 =SUMPRODUCT((A2:A6="7")*(B2:B6="X"))
# of 5 =SUMPRODUCT((A2:A6="5")*(B2:B6="X"))





  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Changing range based on Date

Perfect. Thank you. All three answers worked.



"T. Valko" wrote:

Try this:

=SUMPRODUCT(--(A2:A6=7),--(INDEX(B2:D6,,MATCH(TODAY(),B1:D1,0))="X"))

--
Biff
Microsoft Excel MVP


"KeyloPapa" wrote in message
...
I am counting cells with multiple criteria with the SUMPRODUCT function.

What I would like to do is have the function's 2nd range change as the
current date changes.

IE: If it is 1 Oct it will pull from column B, and then on 2 Oct it pulls
form column C and so on.

How can I change the 2nd range to match the column with the current day?



A B C D
1 | 1 Oct 2 Oct 3 Oct
2 | 7 X X
3 | 7 X
4 | 5 X X
5 | 5 X X X
6 | 5 X


# of 7 =SUMPRODUCT((A2:A6="7")*(B2:B6="X"))
# of 5 =SUMPRODUCT((A2:A6="5")*(B2:B6="X"))








  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Changing range based on Date

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"KeyloPapa" wrote in message
...
Perfect. Thank you. All three answers worked.



"T. Valko" wrote:

Try this:

=SUMPRODUCT(--(A2:A6=7),--(INDEX(B2:D6,,MATCH(TODAY(),B1:D1,0))="X"))

--
Biff
Microsoft Excel MVP


"KeyloPapa" wrote in message
...
I am counting cells with multiple criteria with the SUMPRODUCT function.

What I would like to do is have the function's 2nd range change as the
current date changes.

IE: If it is 1 Oct it will pull from column B, and then on 2 Oct it
pulls
form column C and so on.

How can I change the 2nd range to match the column with the current
day?



A B C D
1 | 1 Oct 2 Oct 3 Oct
2 | 7 X X
3 | 7 X
4 | 5 X X
5 | 5 X X X
6 | 5 X


# of 7 =SUMPRODUCT((A2:A6="7")*(B2:B6="X"))
# of 5 =SUMPRODUCT((A2:A6="5")*(B2:B6="X"))








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing numerical values based upper and lower range jrmcosmo Excel Discussion (Misc queries) 4 September 22nd 09 04:58 PM
Changing values in cell based on system date [email protected] Excel Worksheet Functions 2 October 24th 08 07:33 AM
Source Range Data changing based on drop-down menu [email protected] Charts and Charting in Excel 3 March 9th 08 06:19 PM
How can I increase the value in a cell based on the changing date Cray_z77 Excel Worksheet Functions 5 August 13th 07 04:59 PM
Changing color of single bar based on x-axis date value [email protected] Charts and Charting in Excel 2 August 4th 06 05:17 PM


All times are GMT +1. The time now is 11:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"