IF statement question

T

Tedd

I have a spreadsheet that looks kind of like this:

.10 -4.0 7.1 Total
emp 1 x x
emp 2 x x

What I am trying to do is let a user enter an 'x' in
whatever column they want. Then in the Total column it
will add up the column heading numbers for all the columns
they have an 'x' in.

So with 'emp 1' they entered an 'x' in column '.10'
and '7.1'. So my Total would be '7.2'.

I have tried using an IF statement but I don't think
that's right. Do I need to use somekind of script to do
this?

Any ideas would be great! Thanks.
 
J

jfm

-----Original Message-----
I have a spreadsheet that looks kind of like this:

.10 -4.0 7.1 Total
emp 1 x x
emp 2 x x

What I am trying to do is let a user enter an 'x' in
whatever column they want. Then in the Total column it
will add up the column heading numbers for all the columns
they have an 'x' in.

So with 'emp 1' they entered an 'x' in column '.10'
and '7.1'. So my Total would be '7.2'.

I have tried using an IF statement but I don't think
that's right. Do I need to use somekind of script to do
this?

Any ideas would be great! Thanks.
.
Assuming your worksheet begins with the employees in
column "A", add this SUMPRODUCT formula to your total
column and copy it down:

=SUMPRODUCT((B2:D2="x")*($B$1:$D$1))
 
Top