ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Variable Criteria? (https://www.excelbanter.com/excel-worksheet-functions/57472-variable-criteria.html)

chris2bc

Variable Criteria?
 

I am trying to do a formula where the criteria changes from row to row.
For example, in the following formula I would like to use a cell's
value instead of "4" or "1":

=COUNTIF(A:A,"<=4")-COUNTIF(A:A,"<=1")

Is there a way to do this? If not, I will give a much larger
explanation of what I am trying to do.

I appreciate the help.

Chris


--
chris2bc
------------------------------------------------------------------------
chris2bc's Profile: http://www.excelforum.com/member.php...o&userid=29133
View this thread: http://www.excelforum.com/showthread...hreadid=488535


bpeltzer

Variable Criteria?
 
Use the & operator to combine the operator you want (<=) with the cell
reference containing the value: =COUNTIF(A:A,"<="& F2)
--Bruce

"chris2bc" wrote:


I am trying to do a formula where the criteria changes from row to row.
For example, in the following formula I would like to use a cell's
value instead of "4" or "1":

=COUNTIF(A:A,"<=4")-COUNTIF(A:A,"<=1")

Is there a way to do this? If not, I will give a much larger
explanation of what I am trying to do.

I appreciate the help.

Chris


--
chris2bc
------------------------------------------------------------------------
chris2bc's Profile: http://www.excelforum.com/member.php...o&userid=29133
View this thread: http://www.excelforum.com/showthread...hreadid=488535



chris2bc

Variable Criteria?
 

Ah! Thank you Bruce! Worked like a charm!

--Chris


--
chris2bc
------------------------------------------------------------------------
chris2bc's Profile: http://www.excelforum.com/member.php...o&userid=29133
View this thread: http://www.excelforum.com/showthread...hreadid=488535



All times are GMT +1. The time now is 07:17 PM.

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