Countifs based on another tables components

SageTeamZZ

New Member
Joined
Jul 3, 2019
Messages
3
I have two tables one of them contains a particular's distinct values as a primary key. and another table consists the same particular's multiple values for different dates along with few more details. now based on some conditions i want to bring the outcome count to the first table for further calculation

I HOPE ANY HUMBLE PERSON WILL BE HELP ME ON THE FORMULA

Data Model for both of the tables has been mentioned in the below.

thanks in advance


<tbody>
[TD="class: xl63"]Table-1[/TD]
[TD="width: 259"][/TD]

[TD="class: xl66"]Distinct Line No [/TD]
[TD="class: xl66"]Capacity[/TD]

[TD="class: xl65, align: center"]L1[/TD]
[TD="class: xl64"]60 X Count of Working Days (From Table 2)[/TD]

[TD="class: xl65, align: center"]L2[/TD]
[TD="class: xl64"]60 X Count of Working Days (From Table 2)[/TD]

[TD="class: xl65, align: center"]L3[/TD]
[TD="class: xl64"]60 X Count of Working Days (From Table 2)[/TD]

[TD="class: xl65, align: center"]L4[/TD]
[TD="class: xl64"]60 X Count of Working Days (From Table 2)[/TD]

</tbody>



<tbody>
[TD="class: xl65"]Table-2[/TD]
[TD="width: 259"][/TD]
[TD="width: 64"][/TD]

[TD="class: xl67"]Line No 1[/TD]
[TD="class: xl67"]Date[/TD]
[TD="class: xl67"]Status[/TD]

[TD="class: xl66, align: center"]L1[/TD]
[TD="class: xl68, align: center"]Wednesday, July 3, 2019[/TD]
[TD="class: xl69"]Working[/TD]

[TD="class: xl66, align: center"]L1[/TD]
[TD="class: xl68, align: center"]Thursday, July 4, 2019[/TD]
[TD="class: xl69"]Working[/TD]

[TD="class: xl66, align: center"]L2[/TD]
[TD="class: xl68, align: center"]Wednesday, July 3, 2019[/TD]
[TD="class: xl69"]Working[/TD]

[TD="class: xl66, align: center"]L2[/TD]
[TD="class: xl68, align: center"]Thursday, July 4, 2019[/TD]
[TD="class: xl69"]Working[/TD]

[TD="class: xl66, align: center"]L3[/TD]
[TD="class: xl68, align: center"]Wednesday, July 3, 2019[/TD]
[TD="class: xl69"]Working[/TD]

[TD="class: xl66, align: center"]L3[/TD]
[TD="class: xl68, align: center"]Thursday, July 4, 2019[/TD]
[TD="class: xl69"]Holiday[/TD]

[TD="class: xl66, align: center"]L4[/TD]
[TD="class: xl68, align: center"]Wednesday, July 3, 2019[/TD]
[TD="class: xl69"]Working[/TD]

</tbody>
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Thanks for the concern.

the conditions are status="working" and [Date]>Today()


Book1
ABC
1Line No 1DateStatus
2L17/3/2019Working
3L17/4/2019Working
4L27/3/2019Working
5L27/4/2019Working
6L37/3/2019Working
7L37/4/2019Holiday
8L47/3/2019Working
Sheet2



Book1
ABC
1Distinct Line NoCapacityCount
2L160 X Count of Working Days (From Table 2)1
3L260 X Count of Working Days (From Table 2)1
4L360 X Count of Working Days (From Table 2)0
5L460 X Count of Working Days (From Table 2)0
Sheet1


In C2 of Sheet2 enter and copy down:

=COUNTIFS(Sheet2!$A$2:$A$8,$A2,Sheet2!$B$2:$B$8,">"&TODAY(),Sheet2!$C$2:$C$8,"working")
 
Upvote 0
ABC
Line No 1DateStatus
Working
Working
Working
Working
Working
Holiday
Working

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]

[TD="align: center"]2[/TD]
[TD="align: center"]L1[/TD]
[TD="align: center"]7/3/2019[/TD]

[TD="align: center"]3[/TD]
[TD="align: center"]L1[/TD]
[TD="align: center"]7/4/2019[/TD]

[TD="align: center"]4[/TD]
[TD="align: center"]L2[/TD]
[TD="align: center"]7/3/2019[/TD]

[TD="align: center"]5[/TD]
[TD="align: center"]L2[/TD]
[TD="align: center"]7/4/2019[/TD]

[TD="align: center"]6[/TD]
[TD="align: center"]L3[/TD]
[TD="align: center"]7/3/2019[/TD]

[TD="align: center"]7[/TD]
[TD="align: center"]L3[/TD]
[TD="align: center"]7/4/2019[/TD]

[TD="align: center"]8[/TD]
[TD="align: center"]L4[/TD]
[TD="align: center"]7/3/2019[/TD]

</tbody>
Sheet2

ABC
Distinct Line NoCapacityCount
60 X Count of Working Days (From Table 2)
60 X Count of Working Days (From Table 2)
60 X Count of Working Days (From Table 2)
60 X Count of Working Days (From Table 2)

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]

[TD="align: center"]2[/TD]
[TD="align: center"]L1[/TD]

[TD="align: right"]1[/TD]

[TD="align: center"]3[/TD]
[TD="align: center"]L2[/TD]

[TD="align: right"]1[/TD]

[TD="align: center"]4[/TD]
[TD="align: center"]L3[/TD]

[TD="align: right"]0[/TD]

[TD="align: center"]5[/TD]
[TD="align: center"]L4[/TD]

[TD="align: right"]0[/TD]

</tbody>
Sheet1

In C2 of Sheet2 enter and copy down:

=COUNTIFS(Sheet2!$A$2:$A$8,$A2,Sheet2!$B$2:$B$8,">"&TODAY(),Sheet2!$C$2:$C$8,"working")


I SALUTE YOU

Thank you my friend
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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