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

#### rilzniak

##### Active Member
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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

##### Well-known Member
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

#### rilzniak

##### Active Member
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.

Replies
5
Views
206
Replies
2
Views
46
Replies
2
Views
77
Replies
7
Views
78
Replies
2
Views
177

1,127,327
Messages
5,624,029
Members
416,006
Latest member
PCaffrey

### 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.

### Which adblocker are you using?

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

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