sum help with multiple dates

yogi 6480

New Member
Joined
Oct 20, 2020
Messages
2
Office Version
  1. 365
I am trying to figure out how to the sum numbers from, J7, J14, J23, J30 (class size) etc. as long as the dates in B5, B12, B21, and B28 (class dates)are equal to or have passed from today. I have used this formula =IF(TODAY()-B5, >=0,J7, "") that works for one cell with one date. I am trying to use it for multiple class starts dates with multiple class sizes.



Class start date 1 Sep 20 (cell B5) total class number 20 (cell J7)

Class start date 1 Oct 20 (cell B12) total class number 10 (cell J14)

Class start date 1 Nov 20 (cell B21) total class number 20 (cell J3)

Class start date 1 Dec 20 (cell B28) total class number 10 (cell J30)
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Welcome to the MrExcel forum!

Looking at disjoint ranges is hard enough, but you can sometimes work with them if the various cells are in a regular pattern. In your case, B5 and B12 are 7 rows apart, B12 and B21 are 9 rows apart, and B21 and B28 are 7 rows apart again. No useable pattern. There might also be a way if the dates and/or class size cells are identified by headers in column A and I. It would help if you could show an example of your worksheet. Look at the XL2BB tool in the response box, it shows a nice way to show such an example. I'll use it below.

Without some kind of pattern to use, the only way to do this is by explicitly listing the desired cells in an array. Consider:

Book1
ABCDEFGHIJ
1
2Formula:30
3
4
59/1/2020
6
720
8
9
10
11
1210/1/2020
13
1410
15
16
17
18
19
20
2111/1/2020
22
2320
24
25
26
27
2812/1/2020
29
3010
Sheet10
Cell Formulas
RangeFormula
C2C2=SUM(SUMIFS(OFFSET(J1,{6,13,22,29},0),OFFSET(B1,{4,11,20,27},0),"<="&TODAY()))


But really, this does not scale well. Let us know if there's something else we can use to figure out which cells to use.
 
Upvote 0

Forum statistics

Threads
1,214,791
Messages
6,121,611
Members
449,038
Latest member
apwr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top