-3

I am trying to get a countifs formula to work where the final criteria is an 'or' statement.

The formula looks like this but is not returning the correct value.

=sum(COUNTIFS('Source Data'!A:A,"Mark", 'Source Data'!B:B,"Approved",'Source Data'!C:C,{"PROCESS", "STRATEGY","Hybrid"}))

I have attached a sheet showing raw data example

https://docs.google.com/spreadsheets/d/1JvTa89tHfv00Vzhn51yTEYwe4-jH5zGL/edit?usp=drivesdk&ouid=112526237791774528521&rtpof=true&sd=true

4
  • What is it you expect? Why need to share a file? Can you explain what you mean, so this may also help future visitors to recognize a same issue? Commented Apr 22 at 11:52
  • 1
    Your data has a <space> after the word Strategy . Hence the rows with that content type will not be counted. Either remove the trailing spaces from your data, or change your formula to reflect the trailing space. Commented Apr 22 at 11:52
  • In terms of what I expected, I expected the count for Marks approved content to be 4 from my data set. However the formula seems to only be returning "process" only and not the other criteria e.g strategy or hybrid Commented Apr 22 at 12:05
  • @Raj that is not shown in your question. The question should show the problem, so future visitors with a similar problem can recognize their problem in yours. Commented Apr 22 at 20:33

1 Answer 1

1

As Ron says in the comments you need to remove trailing spaces from "Strategy"....but also your formula is an "array formula", so it will work OK in the latest versions of excel, but in older excel versions it needs to be "array entered" with CTRL+SHIFT+ENTER and in google sheets you need to wrap in "arrayformula" function like this:

=arrayformula(sum(COUNTIFS('Source Data'!A:A,"Mark", 'Source Data'!B:B,"Approved",'Source Data'!C:C,{"PROCESS", "STRATEGY","Hybrid"})))

...or use SUMPRODUCT like this:

=sumproduct(COUNTIFS('Source Data'!A:A,"Mark", 'Source Data'!B:B,"Approved",'Source Data'!C:C,{"PROCESS", "STRATEGY","Hybrid"}))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.