1. Welcome! Please take a few seconds to create your free account to post threads, make some friends, remove a few ads while surfing and much more. ClutchFans has been bringing fans together to talk Houston Sports since 1996. Join us!

Excel question

Discussion in 'BBS Hangout' started by Jackfruit, Sep 26, 2007.

  1. Jackfruit

    Jackfruit Member

    Joined:
    Oct 17, 2005
    Messages:
    1,164
    Likes Received:
    1
    I am creating this spreadsheet and I need help writing an Excel formula. I have a spreadsheet where values can be entered. I need to write a formula that says that if no values have been entered in a particular column (i.e. the cells are blank), then a particular cell (G30 for example) needs to read "NA." If a value has been entered (including a value of 0), then G30 needs to show the summation of the values in A30 divided by the summation of the values in B30.

    Thanks in advance.
     
  2. tulexan

    tulexan Member

    Joined:
    Jul 2, 2007
    Messages:
    1,765
    Likes Received:
    5
    That is a tough one. It would have to be an IF statement, but I don't know how to enter a range as blank. It would be something like:


    =IF(A2="",G30="NA",A30/B30)

    Basically it is saying IF A2 is blank, THEN "NA", ELSE A30/B30

    But I don't know how to get a range of values as the first argument. Sorry I couldn't be anymore help.
     
  3. pugsly8422

    pugsly8422 Member

    Joined:
    Mar 19, 2002
    Messages:
    3,265
    Likes Received:
    349
    =IF(A2="","NA",(SUM(A2:A30)/SUM(B2:B30)))

    So this formula would be written in cell G30, based on your example. The only thing that may be different is instead of A2 you will use some other cell. Give tulexan most of the credit, I only tweaked the formula a bit.

    Pugs
     
  4. tulexan

    tulexan Member

    Joined:
    Jul 2, 2007
    Messages:
    1,765
    Likes Received:
    5
    Yeah that is actually right. I had a bit of a brain fart with the THEN statement.
     
  5. Jackfruit

    Jackfruit Member

    Joined:
    Oct 17, 2005
    Messages:
    1,164
    Likes Received:
    1
    Thanks a lot guys. I appreciate your help.
     

Share This Page