I've got a real tough one here. Need countifs & some weird combo of index/match ?

Mochadrone

New Member
Joined
Dec 15, 2015
Messages
20
Hi everyone,

Let me first start off by saying that this is my first post here on the forum. I've lurked for a while now and answered all of my questions via the helpful and extremely courteous nature of everyone responding to others plea's for help.

I'm unfortunately stumped beyond reason here and have to ask for a hand if possible.

A low down of what I'm trying to do:

I work for a homebuilding company and have been updating their spreadsheets from the dark ages. I'm attempting to create a 'workloads' spreadsheet for construction and warranty. Ideally I will have a formula that will show a count of how many houses each person is currently working on based on 2 ranges and the current month.

I have:
Table2[Projected Staking] (This is the job start date)
Table2[Assistant] (To lookup and match who the house will be counted under)
Table2[Projected Possession] (When the job will no longer be counted)

A table with A4 containing:
Code:
=Today()
mmm,yy formatting.
A5 and onward downwards I'm using this:
Code:
=DATE(YEAR(A4),MONTH(A4)+1,DAY(A4))
as a way to add months.
Columns B-I have Peoples names
(F3 in Countif formula below is the Assistant's Name on the columns)

I've tried:
Code:
=COUNTIFS(Table2[Projected Staking],">="&$A4,Table2[Assistant],Workloads!F$3)
Obviously, the above works. Where my problem lies is when I attempt to somehow get the actual time between Now and Possession and add that to the above code.

For example:
Code:
=COUNTIFS(Table2[Projected Staking],">="&$A4,Table2[Assistant],Workloads!F$3,Table2[Projected Possession],"<="SUM(Table2[Projected Possession])-&$A4)

The problem I have with what I'm trying to do above is that I'm trying to ask it to tell me a specific possession date and subtract that from A4 in order to see weather it actually falls within a valid range BUT it can't pull that date because it's trying to look along a currently untargeted range for an exact date as a reference.) (This is just my assumption as to what's going wrong anyways.)

At the end of the day, as a TEST to see if this is working properly, I'm expecting to be able to put a date earlier than I have data for houses for example, in A4 and see a few zeros in the rows below before they start populating with increasing numbers (as more houses that fall within the parameters occur) and conversely be able to do the opposite by entering a date say, 7 months in the future and seeing the current houses I have start to dwindle to zero.

I've tried a lot of things and believe me, I've made some really fantastically complex formulas before, but just can't seem to get anywhere now. Here's hoping one of you has an answer for me.

Woefully lost,
Adam:eek:
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
"<="SUM(Table2[Projected Possession])-&$A4/QUOTE]

Errors identified while overseeing your formula.

Code:
"<="[B][COLOR=#ff0000]&[/COLOR][/B]SUM(Table2[Projected Pos[COLOR=#ff0000][/COLOR]session])-$A4

But I am confused about why you are Summing the [Projected Possession] instead of getting the Max() from it. Please correct me if I am wrong :rolleyes:
 
Upvote 0
Hi Sixthsense,

I'm trying to get the difference between the projected possession and now in order to hone in the range of my data. I'm not even sure anymore if the approach I made was correct and am willing to try something different if you have any ideas in mind. If you read through the rest of my post you'll get a good feel for what I'm trying to accomplish.
 
Upvote 0
Can you please post some limited data in table form here with your expected result? Which may help us in arriving your expected result :rolleyes:
 
Upvote 0
2 A B C D
3 Dates Joe Rick Gord
4 Dec-15 0 0 0
5 Jan-16 0 0 0
6 Feb-16 0 0 0


The above is where I'd like to have the data populate.
Below is where I'm pulling from,

Assistant Projected Staking Projected Possession
Rick 17-Apr-14 21-Nov-14
Joe 28-Apr-14 17-Dec-14
Gord 12-May-14 31-Dec-14
Gord 20-May-14 8-Jan-15
Rick 29-May-14 17-Jan-15
Joe 10-Jun-14 14-Jan-15
Joe 12-Jun-14 22-Jan-15
Joe 12-Jun-14 28-Jan-15


I hope this better helps you understand my problem.
 
Upvote 0
Assistant2 Projected Staking Projected Possession
Rick 1-Jul-15 26-Jan-16
Joe 1-Aug-15 27-Mar-16
Gord 1-Sep-15 27-Feb-16
Gord 1-Oct-15 27-Dec-16


A B C D
3 Dates Joe Rick Gord
4 Dec-15 1 1 2
5 Jan-16 1 1 1
6 Feb-16 1 0 1

That's a realistic example showing my expected results. Sorry for the confusion.
 
Upvote 0
Source Data
F
G
H
1
Assistant​
Projected Staking​
Projected Possession​
2
Rick​
1-Jul-15​
26-Jan-16​
3
Joe​
1-Aug-15​
27-Mar-16
4
Gord​
1-Sep-15​
27-Feb-16​
5
Gord​
1-Oct-15​
27-Dec-16​

<tbody>
</tbody>

Result
A
B
C
D
1
Dates​
Joe​
Rick​
Gord​
2
15-Dec-15​
1​
1​
2​
3
16-Jan-15​
0​
0​
0​
4
16-Feb-15​
0​
0​
0​

<tbody>
</tbody>

Formula's
B
C
D
2
=COUNTIFS($F$2:$F$5,B$1,$G$2:$G$5,"<="&$A2,$H$2:$H$5,">="&$A2)​
=COUNTIFS($F$2:$F$5,C$1,$G$2:$G$5,"<="&$A2,$H$2:$H$5,">="&$A2)​
=COUNTIFS($F$2:$F$5,D$1,$G$2:$G$5,"<="&$A2,$H$2:$H$5,">="&$A2)​
3
=COUNTIFS($F$2:$F$5,B$1,$G$2:$G$5,"<="&$A3,$H$2:$H$5,">="&$A3)​
=COUNTIFS($F$2:$F$5,C$1,$G$2:$G$5,"<="&$A3,$H$2:$H$5,">="&$A3)​
=COUNTIFS($F$2:$F$5,D$1,$G$2:$G$5,"<="&$A3,$H$2:$H$5,">="&$A3)​
4
=COUNTIFS($F$2:$F$5,B$1,$G$2:$G$5,"<="&$A4,$H$2:$H$5,">="&$A4)​
=COUNTIFS($F$2:$F$5,C$1,$G$2:$G$5,"<="&$A4,$H$2:$H$5,">="&$A4)​
=COUNTIFS($F$2:$F$5,D$1,$G$2:$G$5,"<="&$A4,$H$2:$H$5,">="&$A4)​

<tbody>
</tbody>
 
Upvote 0
Thanks, I'm currently looking to see if this is working. It seems I wasn't so far off after all. You've been a lot of help.
 
Upvote 0

Forum statistics

Threads
1,214,780
Messages
6,121,527
Members
449,037
Latest member
tmmotairi

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