Countifs not returning correct value, need assistance please

Les76

New Member
Joined
Dec 14, 2020
Messages
8
Office Version
  1. 2016
Platform
  1. Windows
I am running a countifs formula to pull the "completed on time" work orders for the month, which are those completed within 30 days of issuance. The correct value should be 69 but the formula is returning 46. To verify, I filtered the data down to October completed and ran the difference (Date completed - Date Issued) in an adjacent column and it totals 69 but this formula returns 46. Am I missing something or is there a way to correct the issue:

=COUNTIFS(Dates,">="&DATE($H$1,10,1),Dates,"<="&DATE($H$1,10,31),Type,$A85,Status,$C$2,Completion,"<="&Dates+30)

Where: Dates - Issue Date; H1 - Current Year; Type and Status - Type of work and status of work order; Completion - Completion date

I've verified that everything up to criteria 5 functions properly and I'm using Excel 2016.

1607982415793.png


1607982278038.png


Thank you for any assistance you can provide as this is driving me crazy!!!
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Welcome to the Board!

You have not structured your COUNTIFS function correctly.
It is:
=COUNTIFS(range1, condition1, range2, condition2, etc...)

See: How to use the Excel COUNTIFS function | Exceljet

If you have multiple conditions to apply on the same range, it still needs to be structured like shown above. Just repeat the range reference.
 
Upvote 0
Try wrapping your formula in SUM.
It may also need array entry, ie Ctrl Shift Enter rather than just Enter
 
Upvote 0
Welcome to the Board!

You have not structured your COUNTIFS function correctly.
It is:
=COUNTIFS(range1, condition1, range2, condition2, etc...)

See: How to use the Excel COUNTIFS function | Exceljet

If you have multiple conditions to apply on the same range, it still needs to be structured like shown above. Just repeat the range reference.
Joe, thank you for the welcome. My formula lists 5 conditions and 5 criteria, so I'm not sure what you mean? Dates, Type, Status and Completion are named ranges. When I eliminate the Completion,"<="&Dates+30, the formula works as it should but doesn't give me the count I'm interested in. There is something wrong with the last piece

=COUNTIFS(Dates,">="&DATE($H$1,10,1),Dates,"<="&DATE($H$1,10,31),Type,$A85,Status,$C$2,Completion,"<="&Dates+30)
 
Upvote 0
Try wrapping your formula in SUM.
It may also need array entry, ie Ctrl Shift Enter rather than just Enter
SUM returned the same value and array entry resulted in 0. Thanks for the suggestions Fluff!
 
Upvote 0
Are your named ranges Dates, Type & Completion all the same size?
 
Upvote 0
I created another named range (Month) wherein I added 30 days to the issue date and tried modifying the formula to reference the new named range and eliminating the Status condition. This new formula results in the same wrong answer:
=COUNTIFS(Dates,">="&DATE($H$1,10,1),Dates,"<="&DATE($H$1,10,31),Type,$A85,Completion,"<="&Month)
 
Upvote 0
Joe, thank you for the welcome. My formula lists 5 conditions and 5 criteria, so I'm not sure what you mean? Dates, Type, Status and Completion are named ranges.
Apologies. I misunderstood that fact.
 
Upvote 0
Can you post some sample date data using the XL2BB add-in that shows the problem.
 
Upvote 0

Forum statistics

Threads
1,214,527
Messages
6,120,054
Members
448,940
Latest member
mdusw

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