Claudia Drechsle wrote:
arnold huzen wrote:

As I see you must define each item. You could use a different formula,
but I don't think, it would be "better":
=SUM(A2:C2)*(A1=3)+SUM(A2:B2)*(A1=2)+A2*(A1=1)
Claudia, I had no idea the formula could be this simple. I noticed that it
doesn't even matter in what order you put the different summaries. That is
something that would be crucial in the example I gave.

Yes, I also often search to complicate and forget the boolean's. A term like
A1=1 provides always a correct result of 1 or 0 that you can include in
lots of formulas. So when you multiplicate with the TRUE/FALSE-value you
have directly excluded all FALSE-items turning them to 0.
And it works alway with characters as A1="x".
The only criticism I would make here is that all of the possible SUMs must be calculated even though only one is required.

The following does the same thing:

=CHOOSE(A1; A2; SUM(A2:B2); SUM(A2:C2))

Ross

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to