ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Defining a Range with Criteria (https://www.excelbanter.com/excel-discussion-misc-queries/199220-defining-range-criteria.html)

Mark R.

Defining a Range with Criteria
 
I'm using a COUNTIF formula as a helper column next to a pivot table. One of
the columns (call it column A) of the pivot table has two possible values,
and I want the COUNTIF formula to only count the data in column B if column A
has a particular value.
That is, I'd like to define the range of COUNTIF to be all rows where Column
A = MyValue. VLOOKUP in the range field doesn't seem to work, and I'm kinda
out of ideas. Any suggestions?

Thanks!

AKphidelt

Defining a Range with Criteria
 
Not sure if this is the problem, but formulas tend to be a problem when using
pivot tables if you click on the cell of the pivot table. In my experience it
is much better to type out the actual range you are wanting to perform
formulas on.

Otherwise post the actual formula you have

"Mark R." wrote:

I'm using a COUNTIF formula as a helper column next to a pivot table. One of
the columns (call it column A) of the pivot table has two possible values,
and I want the COUNTIF formula to only count the data in column B if column A
has a particular value.
That is, I'd like to define the range of COUNTIF to be all rows where Column
A = MyValue. VLOOKUP in the range field doesn't seem to work, and I'm kinda
out of ideas. Any suggestions?

Thanks!


Mark R.

Defining a Range with Criteria
 
Thanks for your reply. Exact formula that I'm using now:

=COUNTIF(AW$6:AW$10000,AW7)

This formula counts AW7=Column B, but does so regardless of the value in
Column A (see above post).

"Mark R." wrote:

I'm using a COUNTIF formula as a helper column next to a pivot table. One of
the columns (call it column A) of the pivot table has two possible values,
and I want the COUNTIF formula to only count the data in column B if column A
has a particular value.
That is, I'd like to define the range of COUNTIF to be all rows where Column
A = MyValue. VLOOKUP in the range field doesn't seem to work, and I'm kinda
out of ideas. Any suggestions?

Thanks!


Mark R.

Defining a Range with Criteria
 
Just found what I needed in another post, courtesy of Gary's Student. Post
follows:

Use SUMPRODUCT(), it can handle multiple columns and multiple criteria:

=SUMPRODUCT(--(A1:A1000="James"),--(B1:B1000="x"))

See:

http://www.xldynamic.com/source/xld.SUMPRODUCT.html

--
Gary''s Student - gsnu200800

"Mark R." wrote:

Thanks for your reply. Exact formula that I'm using now:

=COUNTIF(AW$6:AW$10000,AW7)

This formula counts AW7=Column B, but does so regardless of the value in
Column A (see above post).

"Mark R." wrote:

I'm using a COUNTIF formula as a helper column next to a pivot table. One of
the columns (call it column A) of the pivot table has two possible values,
and I want the COUNTIF formula to only count the data in column B if column A
has a particular value.
That is, I'd like to define the range of COUNTIF to be all rows where Column
A = MyValue. VLOOKUP in the range field doesn't seem to work, and I'm kinda
out of ideas. Any suggestions?

Thanks!



All times are GMT +1. The time now is 02:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com