+ Reply to Thread
Results 1 to 5 of 5

Can't add up

  1. #1
    Registered User
    Join Date
    04-21-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2003
    Posts
    22

    Can't add up

    Hello all – sorry for the long post

    I think that my problem is two fold – in the range G6 – G33 I have a drop down lists containing the following values: “FF”, “PF”, and “ZF”. In the range A6 – A33 I have used the following formula ‘=LOOKUP(G6,{"FF","PF","ZF"},{"3","2","1"})’ to change the letters to numbers so that I can add them up. The formula changes the cell reference as it goes down. This seems to be working. Where these are no letter values in the “G” range I get the #NA result in the A range, I would rather not but I can live with it.

    The real problem is when I try and add using the sum function A6 – A33, in cell G34. It will not add up I get ‘0’ in cell G34. I have tried the formula =SUMIF(A6:A33,">0") in an attempt to get excel to only add the numbers.

    Any ideas?

    Thanks for any help.
    Last edited by NBVC; 04-21-2010 at 01:08 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Can't add up

    =SUMIF(A6:A33,"<>#N/A")

    or change Lookup to:

    =IF(G6="","",LOOKUP(G6,{"FF","PF","ZF"},{"3","2","1"}))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Can't add up

    you could either use
    =SUMIF(A6:A3,"<>#N/A")
    or
    =IF(ISNA(LOOKUP(G6,{"FF","PF","ZF"},{3,2,1})),0,LOOKUP(G6,{"FF","PF","ZF"},{3,2,1}))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    04-21-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: Can't add up

    Thanks guys, the =IF(ISNA(LOOKUP(G6,{"FF","PF","ZF"},{3,2,1})),0,LOOKUP(G6,{"FF","PF","ZF"},{3,2,1})) worked perfectly.

    Thanks for your help, I was pulling my hair out for hours!

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Can't add up

    I understood it as if there are no letters in G6, then you want a blank (or 0) instead of #N/A error....

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1