# If "X=1",?

• I am trying to make a formula within one cell. I want X to equal 1 and I want this one cell to add all my x's up and tell me what it equals.

E.G.

When I do =SUMIF(A1:A6"X=1") it doesnt work.

A is the column and 1-6 are the rows I want the total to include.

• Re: If &quot;X=1&quot;,?

Welcome to Ozgrid!

So in Column A you have some cells with X and some without X?

Can you attach a sample of what you want for results?

Software: OpenOffice 3.0/NeoOffice 3.0 on Mac OS X 10.5.6
Humanware: Older than dirt

Old, slow, and confused - but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3.28.2008)

• Re: If &quot;X=1&quot;,?

If I understand what you are after try

=COUNTIF(A1:A6,"X")

If not, post back.

Software: OpenOffice 3.0/NeoOffice 3.0 on Mac OS X 10.5.6
Humanware: Older than dirt

Old, slow, and confused - but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3.28.2008)

• Re: If &quot;X=1&quot;,?

If you only have Xs in the column, you can use COUNTA(A1:A6). If you have other values in there, use COUNTIF(A1:A6,"X").

:silverha:

• Re: If &quot;X=1&quot;,?

If you have other values in there, use COUNTIF(A1:A6,"X").

Worked -Thanks so much!!

• Re: If &quot;X=1&quot;,?

But now when I try and add the same formula to the next cell (cell to the right) It will automatically change the A to a B b/c it thinks I want to add the next column which I dont.

• Re: If &quot;X=1&quot;,?

COUNTIF(\$A\$1:\$A\$6,"X")

this way the range is 'locked'

"Doubt everything. Find your own light." -- Gautama Buddha

## Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!