Nested IF on OpenOffice Calc


Results 1 to 7 of 7

Thread: Nested IF on OpenOffice Calc

  1. #1
    Join Date
    Sep 1999
    Location
    Santa Cruz, CA, USA
    Posts
    1,212

    Nested IF on OpenOffice Calc

    Code:
    =IF(C2="+"; RIGHT(B2,2); IF(C2="-"; RIGHT(B2,2); RIGHT(C2,1)))
    That's the nested if. Simple really, IF a cell = + then I want the right 2 elements of another cell, if that same cell = - then I want the right 2 elements of another cell otherwise just give me the last element of the cell.

    I have looked all over and from what I have found I have the syntax correct but I am still getting an Err:508
    One by one the penguins steal my sanity...

    Vanpooling now...

  2. #2
    Join Date
    Sep 1999
    Location
    Santa Cruz, CA, USA
    Posts
    1,212
    Anyone?
    One by one the penguins steal my sanity...

    Vanpooling now...

  3. #3
    Join Date
    Oct 2003
    Location
    Seattle
    Posts
    94
    I'm not sure I completely understand what you want your result to be, but if I'm reading your formula correctly, this is what worked for me.

    =IF(OR(C2="+";C2="-");RIGHT(B2;2);RIGHT(C2;1))

  4. #4
    Join Date
    Sep 1999
    Location
    Santa Cruz, CA, USA
    Posts
    1,212

    Doesn't work

    I have OpenOffice 3.0
    Open SuSE 11.0
    KDE 3.5

    In column B there are entries like below:

    s3nD+
    s2nC
    s1nA
    s1nA+
    s1nA
    s1nB-
    s1nA
    s1nA
    s1nA+
    s1nA
    s1nA
    s1nB
    s1nA-
    s1nA

    I want the to extract the right most character if there is no + or -.

    If there is a + or - then I want to extract the 2 right most characters.

    I can get it to work with one but not two. Never mind, I found another solution. Thanks though!
    One by one the penguins steal my sanity...

    Vanpooling now...

  5. #5
    Join Date
    Oct 2003
    Location
    Seattle
    Posts
    94
    Ah, I think I see what you wanted now. I know you've already found your solution but I'll post my formula anyway.

    =IF(OR(RIGHT(B2;1)="+";RIGHT(B2;1)="-");RIGHT(B2;2);RIGHT(B2;1))

    I have OO 2.4 on Debian Lenny.

  6. #6
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,936
    I've never used OO macros at all, so this syntax may be horrifically wrong. But another solution seems to present itself:

    =RIGHT(B2, LENGTH(B2)-3)

    Should work whether a + is present, a - is present, or neither is present -- at least for the input list you gave.

  7. #7
    Join Date
    Oct 2003
    Location
    Seattle
    Posts
    94
    I bow to the master
    I knew all those RIGHTs bothered me! Syntax is a little off but a lesson well learned.

    =RIGHT(B2;LEN(B2)-3)

    thanks bwkaz!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •