Required formula to generate Leave Register-Additional Requirement

vs_suresh

New Member
Joined
Apr 4, 2016
Messages
5
Hello team,

I have an additional requirement to my existing sheet where I will specify the period 'From' & 'To' and based on the selection, it should fetch the data.

I have changed the existing formula from =COUNTIFS(Data!$B$3:$B$40,">="&C$16,Data!$B$3:$B$40,"<"&EDATE(C$16,1),INDEX(Data!$C$3:$L$40,,MATCH($B3,Data!$C$2:$L$2,)),"x")
to
=COUNTIFS(Data!$B$3:$B$40,">="&$D$2,Data!$B$3:$B$40,"<="&EDATE($F$2,1),INDEX(Data!$C$3:$L$40,,MATCH($B7,Data!$C$2:$L$2,)),"X") but not getting the expected results. Please check the attached file in Sheet 'ResultPeriod'

Please help..

Sample_LeaveBook2.xlsx
BCDEF
2Select -- >>Period From2/1/21Period To2/15/21
3
4
5Leave for the PeriodExpected Result
6Name
7Johan21
8Micheal 
9Thomas32
10Ahmed1
11Frank1
12Greg21
13Micky1
14Trace11
15Lisy1
16Saraham11
17Total13
ResultPeriod
Cell Formulas
RangeFormula
C7:C16C7=COUNTIFS(Data!$B$3:$B$40,">="&$D$2,Data!$B$3:$B$40,"<="&EDATE($F$2,1),INDEX(Data!$C$3:$L$40,,MATCH($B7,Data!$C$2:$L$2,)),"X")
C17C17=SUM(C7:C16)
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Could you post a sample of the "Data" worksheet, please?
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,003
Members
448,935
Latest member
ijat

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