On Fri, 2012-09-21 at 00:34 -0500, Paul Anderson wrote:
> Thanks to all for the previous help,
> 
> Also, sorry if you have addressed this already, Brian. But, I know only 
> basic functions within the spreadsheet and will request a more 
> explanatory example.
> The file was delivered in xlsx format. I would like to maintain the 
> format (using LibreOffice!), but I may have to look to other software.
> 
> Here is an example of my first two rows of data, cells F2&3 through 
> S2&3, with F1-S1 containing variable names
> 
> *F*   *G*     *H*     *I*     *J*     *K*     *L*     *M*     *N*     *O*     
> *P*     *Q*     *R*     *S*
> 0     1       0       1       0       0       1       0       0       0       
> 0       0       0       0
> 1     0       1       1       0       0       1       0       0       0       
> 1       0       0       0
> 
> 
> Using a simple example with only two cells (F2&L2), I want T2 to equal a 
> 'score' based on a weighted index, like this:
> 
> IF F2=0 then T2=0; else T2=T2+1;
> (Where F2 can only take on a value of 0 or 1)
> AND
> IF L2=0 OR L2=1 OR L2=2 then T2=T2+0; else T2=T2+3
> (Where L2 can take on a value of 0,1,2,or 3)
> 
> So that:
> 
> T2 = 0 (if F2=0 and L2=0,1,or 2)
> OR
> T2 = 4 (if F2=1 and L2=3)
> 
> I haven't been able to create the proper syntax for this simple two cell 
> scoring.
> How can I not only score an individual cell but also link it with 
> another cell in the same row?
> A simple demonstration will be adequate so that I can create my specific 
> and more complicated function.
> 
> I hope I have stated my needs in a clearer fashion this time around, and 
> thanks to everyone for the previous help.
> 
> Regards,
> -Paul
> 
> On 9/19/2012 11:58 AM, Jean-Francois Nifenecker wrote:
> > Le 19/09/2012 07:03, Paul Anderson a écrit :
> >> Hello all,
> >>
> >> I have a simple question for which I cannot find the answer.
> >>
> >> I have a LibreCalc spreadsheet containing binomial data for which I
> >> would like to create a final summed "score" (in Column T) based upon a
> >> manually specified score index.
> >>
> >> Columns F, G, H, J, K, M, N, O, P, O, and R contain pure binomial
> >> information (0 or 1)
> >> Columns I, L, and S contain multiple numbered responses:
> >> I = 0,1,3
> >> L = 0,1,2,3
> >> S = 0,1,2
> >>
> >> I want to create a final score (Column T) based upon numerical responses
> >> (in Columns F-S)
> >>
> >
> > All this makes me think of binary data, hence to have columns F..R 
> > (except I, L & S) set to hold either 0 or a power of 2.
> > F would hold 0 or 1
> > G            0 or 2
> > H            0 or 4
> > J            0 or 8
> > and so forth.
> >
> > Then, adding any group of columns would then give a unique meaningful 
> > value:
> > -- if you add F+G+H and get 3, you know that only F and G are set
> > -- if you AND F+G+H with, say, 2, you may check if G (value 2) is set 
> > : if G AND 2 = 2 then G is set (in Calc use the BITAND function)
> >
> > As I don't know exactly what you're looking to achieve, perhaps my 
> > idea is useless.
> >
> > Anyway, just my two euro-cents

As I look more and more at this I wonder if a spreadsheet is the right
tool for the job.  It seems like what you need is a language (a little
dated here) pilot, which was specifically created for writing tests and
scoring them by an educator.  There are also very nice packages for
Prolog that can handle this type of coding.

        First of all T2 must have some value or be formatted to begin with.
(format->cell something).  Next you cannot do this without referential
addressing.  Look that up.  The reference needs to include the sheet and
cell.  Finally none of the code can actually go in the T2 cell. It can
ONLY be a results cell, or things get nasty quickly.

So for example we could code cell x2 with the formula for one bit and
cell x3 with the formula for the second bit, but then you would have to
set the calc options to control the resolution iterations which may or
may not work in the end.  My recommendation is to put the keys on one
sheet and the formulas on a following sheet.  Then the keys are entered,
the second sheet is evaluated and gives you the answers.  It should also
allow you to lock the calculation sheet if that is of any interest to
you.

I get good fees for homework.  Usually about $55/hour, or 3 gallons of
coffee, which ever works best for me.  This late at night, its the
coffee.

Regards,
Les H

IF F2=0 then T2=0; else T2=T2+1;
> (Where F2 can only take on a value of 0 or 1)
> AND
> IF L2=0 OR L2=1 OR L2=2 then T2=T2+0; else T2=T2+3
> (Where L2 can take on a value of 0,1,2,or 3)
> 


-- 
For unsubscribe instructions e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to