Using = or > or < or >= or <= in a Formula based on Drop-Down Entry

rilzniak

Active Member
Joined
Jul 20, 2012
Messages
288
Hey geniuses!

I have a drop-down which I'm using right now for a data set that has two columns I'm counting/summing/averaging. I'm calculating a count for the range but want to add a twist with one of the operator symbols (=, >, <, >=, <=) as part of the formula but it doesn't want to work for me. Here's an edited version of my count formula:

=COUNTIFS ( A2:A100 , "A" , D2:D100 , $C$2 & $D$2 , E2:E100 , $F$2 & $G$2 )

C2 is a drop-down with =, >, <, >=, <= as options
D2 is a drop-down with 1 to 11 options
F2 is the same as C2
G2 is 1 or 2

I'll also be applying this same formula to a sum and an average once I have this figured out. Thanks in advance.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi Rilnziak,

It seems to work for me (although I'm not sure you want to use D2 as the drop-down and have it as a part of the COUNTIFS)

Rilzniak.xlsx
ABCDEFGHI
1
2A<31>=22
3A12
4A23
5A34
6A45
7A56
8A67
9A78
10A89
11A910
12B1011
Sheet1
Cell Formulas
RangeFormula
I2I2=COUNTIFS(A2:A100,"A",D2:D100,$C$2&$D$2,E2:E100,$F$2&$G$2)
Cells with Data Validation
CellAllowCriteria
C2,F2List>,<,>=,<=,=
D2List1,2,3,4,5,6,7,8,9,10,11
 
Upvote 0
Hi Rilnziak,

It seems to work for me (although I'm not sure you want to use D2 as the drop-down and have it as a part of the COUNTIFS)

Rilzniak.xlsx
ABCDEFGHI
1
2A<31>=22
3A12
4A23
5A34
6A45
7A56
8A67
9A78
10A89
11A910
12B1011
Sheet1
Cell Formulas
RangeFormula
I2I2=COUNTIFS(A2:A100,"A",D2:D100,$C$2&$D$2,E2:E100,$F$2&$G$2)
Cells with Data Validation
CellAllowCriteria
C2,F2List>,<,>=,<=,=
D2List1,2,3,4,5,6,7,8,9,10,11
Opened up a new workbook and tried your example and it worked perfectly. So...I try it again in the original workbook I had by copying the formula and it worked. Sigh. I can't be bothered to figure out what went wrong.

Thank you, Toadstool, you wizard!
 
Upvote 0

Forum statistics

Threads
1,214,948
Messages
6,122,420
Members
449,083
Latest member
Ava19

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