Combination Sumif and/or Countif on a condition

rex759

Well-known Member
Joined
Nov 8, 2004
Messages
608
Office Version
  1. 365
Platform
  1. Windows
Hi,
I want to determine if there's a gap between dates for each week and team.
For example, Team A on week 1 has dates of 1/30 & 1/31 so there is no gap between the dates.
Team A on week 2 has dates of 2/6, 2/7 & 2/9 creating a gap between 2/7 & 2/9.
The dates in the column may not run chronological order

I thought I could used something like SUMIFs or a combination of Sumifs and Countif but not sure how to work in if a date in a range is greater than 1 day.
Below is an example with results.

Any advice/help is appreciated.

Travel.xlsx
ABCDEFGH
1dateWeek#TeamResults
21/30/241AIs there a gap?
31/31/241ATeamWeek #
42/1/241B123
52/6/242AANOYESNO
62/6/242CBNONONO
72/7/242ACNOYESYES
82/7/242C
92/8/242B90643
102/9/242A
112/9/242B
122/9/242C
132/12/243C
142/13/243C
152/15/243C
162/16/243C
Sheet1
Cell Formulas
RangeFormula
E9E9=SUMIFS(A2:A16,B2:B16,F4,C2:C16,E5)
B2:B16B2=INT((A2-DATE(2024,1,29))/7)+(WEEKDAY(A2)<7)
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
How about
Fluff.xlsm
ABCDEFGH
1dateWeek#TeamResults
230/01/20241AIs there a gap?
331/01/20241ATeamWeek #
401/02/20241B123
506/02/20242AANoYesNo
606/02/20242CBNoNoNo
707/02/20242ACNoYesYes
807/02/20242C
908/02/20242B
1009/02/20242A
1109/02/20242B
1209/02/20242C
1312/02/20243C
1413/02/20243C
1515/02/20243C
1616/02/20243C
Data
Cell Formulas
RangeFormula
F5:H7F5=LET(f,FILTER($A$2:$A$100,($B$2:$B$100=F$4)*($C$2:$C$100=$E5)),IFERROR(IF(MAX(f)-MIN(f)+1=ROWS(f),"No","Yes"),"No"))
B2:B16B2=INT((A2-DATE(2024,1,29))/7)+(WEEKDAY(A2)<7)
 
Upvote 0
Solution
wow, that was quick! Yes, that works. Havent used the "Let" function and just started playing with Filter. Amazing! Thank you
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,071
Messages
6,122,964
Members
449,094
Latest member
Anshu121

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