COUNTIFS

j4ymf

Well-known Member
Joined
Apr 28, 2003
Messages
743
Office Version
  1. 365
Platform
  1. Windows
Hello All

I was wondering how would write this countif formula for this count if query.

the count IF counts how may £12.80 there are, but i woul dlike it to pick up the identicle seals, so the result should be 3 and not 2.

many thanks





03.xlsx
ABCDEFGHIJKLMNOP
5Installation DateSeal IDFire RatingLevelLocationSeal TypeXYPenetrating ServiceCommentsDrawing RefCost BreakdownSchedule of RatesWorking Through Grid - 0.5 % upliftIdentical sealsTotal Cost
607 Oct 2022MN-0209Working Through Grid - 60 minL4Room 48Mastic Only Penetration5050Cable652-586 B Fire Stretegy Plan - Floor 4Mastic Only Penetration: 19.20 £12.80£6.401£38.40
707 Oct 2022JP-0003Working Through Grid - 60 min451Mastic Only Penetration5050Cable652-586 B Fire Stretegy Plan - Floor 4Mastic Only Penetration: 19.20 £12.80£6.40£19.20
8
9
10Schedule of rates
11Number of Seals£12.80£18.80£27.80£37.40£46.40£53.20£61.30£63.20£71.90£77.60£83.20£92.00
12Mastic Only Penetration31200000000000
13Intumescent Batt and Mastic12000000000000
Sheet1
Cell Formulas
RangeFormula
M6:M7M6=IF(OR(C6={"Working Through Grid - 30 min","Working Through Grid - 60 min","Working Through Grid - 90 min","Working Through Grid - 120 min"}),IF(AND(O6>=1,O6<=5),P6/((O6+1)*1.5),P6/1.5))
N6:N7N6=IFS(OR(C6="Working Through Grid - 60 min",C6="Working Through Grid - 30 min",C6="Working Through Grid - 120 min"),M6/2,OR(C6="60 Min",C6="30 Min",C6="Air Seal",C6="120 Min",C6="90 Min",C6="Acoustic Seal"),"")
B12:B13B12=COUNTIFS( $F$6:$F$4963, A12)
C12C12=COUNTIFS($F$6:$F$7,$A$12,$M$6:$M$7,C11)
D12:N12D12=COUNTIFS($F$4:$F$895,$A$12,$M$4:$M$895,D11)
C13:N13C13=COUNTIFS($F$4:$F$895,$A$13,$M$4:$M$895,C11)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C22:L23,C25:L26,C18:L18,C16:L16,C12:N14,G15:L15Cell Value=0textNO
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Do a helper column in rows 5-7 containing the total number of seals (= Identical seals + 1). Then do SUMIFS on the helper column.

If you don't want an extra column, you can add a SUMIFS on the Identical column to your COUNTIFS.

=COUNTIFS($F$6:$F$7,$A$12,$M$6:$M$7,C11)+SUMIFS($O$6:$O$7,$F$6:$F$7,$A$12,$M$6:$M$7,C11)
 
Upvote 0
Solution
Thank you Automatrix, that's fantastic.
Much appreciated
 
Upvote 0
You're welcome. You should consider arranging your data in a named table, as it will allow you to use (much more readable) structured references in your formulas.

Excel Formula:
=COUNTIFS(Table1[Seal Type],$A$12,Table1[Schedule of Rates],C11)+SUMIFS(Table1[Identical seals],Table1[Seal Type],$A$12,Table1[Schedule of Rates],C11)

This will also allow you to add data to your table without having to change the formulas.
 
Upvote 0
You should consider arranging your data in a named table, as it will allow you to use (much more readable) structured references in your formulas.
That is very subjective. I find that structured references are far harder to read than a normal range & can make a short formula very long thereby also making it harder to read.
IMO there are far more cons to a table than pros.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

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