Help - Search - Members - Calendar
Full Version: Excel Countif Question
Suggest A Fix PC Support Forums > General Computing > Applications and Office Programs
bikerhal
How do you use COUNTIF (or SUMIF) when the criterion value is contained a cell.

For example, I want to count all entries in A1 to A5 that are greater than the contents in cell B1

COUNTIF(A1:A5, >B1) does not work
nor does
COUNTIF(A1:A5, ">B1")

However, for equality, COUNTIF(A1:A5, B1) does work

I'm using Excel 2003

Thanks
bikerhal
QUOTE(bikerhal @ Apr 15 2008, 08:44 AM) *

How do you use COUNTIF (or SUMIF) when the criterion value is contained a cell.

For example, I want to count all entries in A1 to A5 that are greater than the contents in cell B1

COUNTIF(A1:A5, >B1) does not work
nor does
COUNTIF(A1:A5, ">B1")

However, for equality, COUNTIF(A1:A5, B1) does work

I'm using Excel 2003

Thanks



I found the answer laugh.gif

COUNTIF(A1:A5, ">"&B1)

Nowhere could I find in the Excel Help file the use of & in this manner.
Dino
Thanks for the feedback, I looked into Excel’s Help and I couldn’t find any mention of the symbol & as well.
Dashwood95
It is actually in the help if you know how to look for it....which I did not did. I had to sit there and figure out what in the sam heck they wanted that for.

It dawned on me that you could have saved yourself a world of headache by using the standard ">25" in place of your ">"&B1 (25 being a number I picked not knowing what was in your B1).

It dawned on me next that you probably wanted to use B1 because you may later change the value in that cell, thereby changing the end result of your calculation.

So I had to understand what the & was for. I get it now. I'm not sure I'll remember it, but I finally get it. smile.gif Thanks for the pearl of wisdom bikerhal. I thoroughly enjoy learning new formula tricks so you made my day.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.