Need Single Formula

gnaga

Well-known Member
Joined
Jul 9, 2002
Messages
748
Office Version
  1. 365
  2. 2016
  3. 2013
Platform
  1. Windows
Book1
IJKLMN
60130
71245
82356
97467
1016-Nov-2148778
1117-Nov-215
1218-Nov-216
1319-Nov-217
1420-Nov-210
1521-Nov-211
1622-Nov-212
1723-Nov-213
1824-Nov-214
1925-Nov-215
2026-Nov-216
2127-Nov-217
2228-Nov-210
2329-Nov-211
2430-Nov-212
25
26
27
2816-Nov-218778
2930-Nov-21
Sheet1
Cell Formulas
RangeFormula
K10:N10K10=COUNTIF($J$10:$J$24,K6)+COUNTIF($J$10:$J$24,K7)+COUNTIF($J$10:$J$24,K8)+COUNTIF($J$10:$J$24,K9)
J10:J24J10=MOD(I10,8)
K28:N28K28=K10


I need single formula in the Yellow Cell.

Basically I want to get number of days falling on specific category between two dates.

Input : From Date & To Date
Category : Mod(Date,8) = 0,1,2,3,4,5,6,7

Output : Number of days for each category.
 
Please refer my Post # 5. My Dates are not expanded each day. It is only stored in two cell. FROM DATE in I28 and TO DATE in I29. Just for the explanation purpose I expanded that in the range I10:I24.
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
This use start date in I28, end date in I29

K28:

=SUMPRODUCT(COUNTIF(K$6:K$9,MOD(ROW(INDIRECT($I$28&":"&$I$29)),8)))

Drag accross
 
Upvote 0
This use start date in I28, end date in I29

K28:

=SUMPRODUCT(COUNTIF(K$6:K$9,MOD(ROW(INDIRECT($I$28&":"&$I$29)),8)))

Drag accross
Perfect bebo021999 ???. This is what I was expecting. Thank you so much..???
 
Upvote 0
=SUMPRODUCT(COUNTIF(K$6:K$9,MOD(ROW(INDIRECT($I$28&":"&$I$29)),8)))

I would like to modify the above formula to get the desired result for the specific weekday for example Sunday. I modified like the below one but getting zero as result.

=SUMPRODUCT(COUNTIF(K$6:K$9,MOD(ROW(INDIRECT($I$28&":"&$I$29)),8)),WEEKDAY(ROW(INDIRECT($I$28&":"&$I$29)))=1)

Where is the mistake??? Any idea folks!!!
 
Upvote 0
Like this?
Code:
=SUMPRODUCT(COUNTIF(K$6:K$10,MOD((ROW(INDIRECT($I$28&":"&$I$29))/(WEEKDAY(ROW(INDIRECT($I$28&":"&$I$29)))=1)),8)))
 
Upvote 0
Solution
Excellent bebo021999 ??. Thank you very much ???. It works nice..
 
Upvote 0

Forum statistics

Threads
1,214,814
Messages
6,121,711
Members
449,049
Latest member
THMarana

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