From koffice-devel Mon Aug 23 12:45:19 2004 From: Tomas Mecir Date: Mon, 23 Aug 2004 12:45:19 +0000 To: koffice-devel Subject: Re: [PATCH] New function for KSpread: SUMIF() Message-Id: <492258b104082305451a6d7705 () mail ! gmail ! com> X-MARC-Message: https://marc.info/?l=koffice-devel&m=109326515525627 Greetings! On Sat, 14 Aug 2004 12:29:54 +0000, Bram Schoenmakers wrote: > This patch implements the SUMIF()-function, which sums all values matching a > criteria. I've split the patch up to two parts: > > diff1 --- A preparation. It moves some criteria-related code from > kspread_functions_database.cc to kspread_functions_helpers.cc, so all > function can benefit of using criterias. Currently, COUNTIF() only supports > the relation 'equals to', but because it can access the match-methods now, it > supports all kind of operators. > I'll have a look if there are more functions which could use this. Hm, maybe. But I believe that things like this would be better implemented as array formulas, which can do all this and more :D > Remains only one question: > I don't get the KSValue-structure when a range-argument is supplied. It seems > there are lists-in-lists, but I don't know why. If the range A1:A2 (with 2 > doubles) is selected, the two values are stored like > > > > > > > > > > > Why is there a single-entry list inside the main list? Hm, not 100% sure here, but I think that's rows and columns, A1:A2 has 2 rows, with 1 value in each. Hence, your implementation may fail if you give it something that has more than one column - haven's tested that yet, so please have a look what will your function do if you give it a row or some arbitrary range... / Tomas _______________________________________________ koffice-devel mailing list koffice-devel@mail.kde.org https://mail.kde.org/mailman/listinfo/koffice-devel