Count the data in column on sheet 2 from results in column on sheet 1 after matching data in corresponding column

DanJones

New Member
Joined
Jan 31, 2022
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Sheet1
1643627655808.png
Sheet 2
1643627768389.png


Hi, I am trying to do a calculation if column D in Sheet 1 = As Built, it takes the corresponding data in Column K and counts the occurrences of it in Column H on Sheet 2. I have tried all sorts of combinations of INDEX, COUNT, SUMPRODUCT etc. the closest I am getting is =SUMPRODUCT(--ISNUMBER(MATCH('CBT OR Chamber'!K:K,'SY-property-statuses'!H:H,0))) but that is not taking into account the column D in Sheet 1 = As Built. Please help, new to this forum and it's the first time I have been this stuck, so sorry if it is a stupid repeated question!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Hi & welcome to MrExcel.
Which sheet are you putting the formula in?
 
Upvote 0
Thank you, I am putting the formula in a separate summary sheet
 
Upvote 0
Ok, how about
Excel Formula:
=ROWS(FILTER('SY-property-statuses'!H2:H1000,ISNUMBER(MATCH('SY-property-statuses'!H2:H1000,FILTER('CBT OR Chamber'!K2:K1000,'CBT OR Chamber'!D2:D1000="As Built"),0))))
 
Upvote 0
I am getting #CALC! ... I think because some of the cells in sheet 2 column H are blank, is there a quick way to ignore blanks or have I misunderstood the result.
 
Upvote 0
The #Calc means that one of the two filter functions returned no results.
If you use this, does it return anything
Excel Formula:
=FILTER('CBT OR Chamber'!K2:K1000,'CBT OR Chamber'!D2:D1000="As Built")
 
Upvote 0
That gives me #SPILL! I do not have "As Built" in column K, only in column D, in column K I have a list as shown above, it is the corresponding data next to "As Built" i.e. in the example above SY/CBT/159 that I want to count the occurrences of it in Column H on Sheet 2, SY/CBT/159 would be 10 but in the example above I would want the total of SY/CBT/159, SY/CBT/160, SY/CBT/161 up to SY/CBT/164
1643632449219.png
 

Attachments

  • 1643632475293.png
    1643632475293.png
    41.9 KB · Views: 6
Upvote 0
That gives me #SPILL!
That means that it has found some values, but there are populated cells stopping the formula from spilling down.
Which suggests that the values from col K where not found in col H on the other sheet.
 
Upvote 0
Odd, it is as you can see above the values from col K are shown in col H in the 2 examples above with the example I have given - SY/CBT/159
 
Upvote 0
Check that none of those values have leading/trailing spaces, or other hidden characters.
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,849
Members
449,051
Latest member
excelquestion515

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