The 'best' way to do this depends on what it is you want in the end. There are several ways to make it work. If .. then .. else will work, especially if you want to be able to copy the formula to other cells.
Further you could use a formula to search in a range and then assign a value. Since I use the dutch version of OOo I'm not sure what the English equivalent of the formula is but I'll explain how it works. The formula looks like this =VERT.ZOEKEN(A1;G1:H3;2). It instructs Calc to search vertically for the value in cell A1. The value must be found in the range G1 to H3. If the value is found then it will return the value that is found in column 2 of the range to the cell containing the formula. Arnold Huzen Kirill S. Palagin schreef: > Hello. > > I need to sum the range of cells with the range itself depending on > parameter, that is > if $A$1 is 1, then Sum(A2:A2), > if $A$1 is 2, then Sum(A2:B2), > if $A$1 is 3, then Sum(A2:C2), > etc. > So far I see very inelegant solution involving IF with each item to be > summed. > Is there a better way? > > Thanks a lot. > WBR, > K. Palagin. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
