Jump to content

Wikipedia:Reference desk/Archives/Mathematics/2017 October 19

From Wikipedia, the free encyclopedia
Mathematics desk
< October 18 << Sep | October | Nov >> October 20 >
Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


October 19

[edit]

Using COUNTIF in Excel

[edit]

Assume I have an Excel spreadsheet with data like this:

A B
1 Mon 4.25
2 Tue 5.75
3 Wed
4 Thu 5.5
5 Fri
6 Mon 5.25
7 Tue
8 Wed 3.25
9 Thu 5.5
10 Fri 2.7

I can find out the total for any given day of the week as the formula =SUMIF(A1:A10,"Mon",B1:B10) (which returns 9.5) but how do I find out the count of non-blank entries in column B for a given day? I thought of COUNTIF, as in the formula =COUNTIF(A1:A10,"Mon",B1:B10) but it only accepts two arguments. What I want is something that for the example above will return a value of 2 for Monday and Thursday, and a value of 1 for Tuesday, Wednesday and Friday. --Redrose64 🌹 (talk) 21:16, 19 October 2017 (UTC)[reply]

Are you aware of the COUNTIFS function? It is just COUNTIF but with multiple conditions. You should be able to use =COUNTIFS(A1:A10,"Mon",B1:B10,">0") to count how many Mondays there are with a positive value associated with them. AlfonsoAnonymous (talk) 01:33, 20 October 2017 (UTC)[reply]
Thank you, that worked. --Redrose64 🌹 (talk) 11:14, 20 October 2017 (UTC)[reply]

Location of question

[edit]

Just wondering (and not angrily), is there any guidance to whether questions like this should be placed here or at RD:Computing? I'm thinking that Excel gurus might be more likely to watch RD:Computing (though apparently at least one watches here... :) ) Naraht (talk) 13:44, 20 October 2017 (UTC)[reply]