COUNTIF Rules

Drewmyster

Board Regular
Joined
May 16, 2007
Messages
151
Office Version
  1. 365
Platform
  1. Windows
Hi there,

Is there a way for me to count the sum of a list of figures that match certain text?

For example, if in column A I have text, and I want to look up all cells that return the word "Monday" and then calculate the sum total of the data from column B, how can I do this?

Thanks
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Thanks Andrew, that was just what I was after.

Also, I would like to know if there is a formula to return the highest and lowest figures from a range?
 
Upvote 0
if you want the highest value For Monday
=MAX(IF(A2:A24="Monday",B2:B24))
and Lowest
=MIN(IF(A2:A24="Monday",B2:B24))

and both is Array formula Must Entered By Ctrl+Shift+Enter
 
Upvote 0
if you want the highest value For Monday
=MAX(IF(A2:A24="Monday",B2:B24))
and Lowest
=MIN(IF(A2:A24="Monday",B2:B24))

and both is Array formula Must Entered By Ctrl+Shift+Enter

Thanks Yahya that's really helpful. If I could ask one final thing about this formula, can I also check the Max and Min of data from a date range?

For example, as the spreadsheet is quite old, if I want to check the highest and lowest figures, for Mondays, in 2010 when column C is the date (dd-mmm-yyyy). Can I ask for the formula to only lookup Mondays within the year I need?

Thanks for all your help.
 
Upvote 0
see this please
Excel Workbook
ABCDEF
1DayAmountDate
2Sunday26001-May-2010DayMonday
3Monday43916-May-2010Year2010
4Tuesday14131-May-2010
5Wednesday37915-Jun-2010MAX439
6Thursday37830-Jun-2010MIN206
7Friday42415-Jul-2010
8Saturday58530-Jul-2010
9Sunday4914-Aug-2010
10Monday22729-Aug-2010
11Tuesday32213-Sep-2010
12Wednesday58828-Sep-2010
13Thursday39013-Oct-2010
14Friday54328-Oct-2010
15Saturday4212-Nov-2010
16Sunday25827-Nov-2010
17Monday20612-Dec-2010
18Tuesday44527-Dec-2010
19Wednesday50811-Jan-2011
20Thursday31326-Jan-2011
21Friday29210-Feb-2011
22Saturday14825-Feb-2011
23Sunday45812-Mar-2011
24Monday75027-Mar-2011
25Tuesday12711-Apr-2011
26Wednesday32326-Apr-2011
27Thursday57911-May-2011
28Friday54026-May-2011
29Saturday19010-Jun-2011
30Sunday13125-Jun-2011
Sheet4
Excel 2007
#VALUE!
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
 
Upvote 0
Any chance I can take this formula even further? My boss has asked me to find search for the month array also. So using the sample spreadsheet you posted previously, is there a formula to filter out the month of June 2011 for example?

Thanks.
 
Upvote 0
try this one
Excel Workbook
ABCDEFG
1DayAmountDateMonthJune
2Sunday26001-May-2010Year2011
3Monday43916-May-2010
4Tuesday14131-May-2010
5Wednesday37915-Jun-2010DayAmountDate
6Thursday37830-Jun-2010Saturday19010-Jun-2011
7Friday42415-Jul-2010Sunday13125-Jun-2011
8Saturday58530-Jul-2010
9Sunday4914-Aug-2010
10Monday22729-Aug-2010
11Tuesday32213-Sep-2010
12Wednesday58828-Sep-2010
13Thursday39013-Oct-2010
14Friday54328-Oct-2010
15Saturday4212-Nov-2010
16Sunday25827-Nov-2010
17Monday20612-Dec-2010
18Tuesday44527-Dec-2010
19Wednesday50811-Jan-2011
20Thursday31326-Jan-2011
21Friday29210-Feb-2011
22Saturday14825-Feb-2011
23Sunday45812-Mar-2011
24Monday75027-Mar-2011
25Tuesday12711-Apr-2011
26Wednesday32326-Apr-2011
27Thursday57911-May-2011
28Friday54026-May-2011
29Saturday19010-Jun-2011
30Sunday13125-Jun-2011
Sheet4
Excel 2007
#VALUE!
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
 
Upvote 0
Sorry to return to this topic this late, but is it possible to use the COUNTIF function more than once in a formula?

For what I'm now doing I'd need to filter 2 seperate columns to search for text results.

So far I've got;

=COUNTIF('Accounts'!A:A,"July"),COUNTIF('Accounts'!B:B,"Debit")

This formula doesn't work, but I think you can see what I'm trying to do.

Any help appreciated.

Thanks
 
Upvote 0
Example:

=SUMPRODUCT(--('Accounts'!A1:A1000="July"),--('Accounts'!B1:B1000,"Debit"))

change the range references to suit but make sure that they have the same number of rows and avoid using entire columns. If you have Excel 2007 or above you can use the COUNTIFS function.
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,480
Members
452,915
Latest member
hannnahheileen

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