Consulting

Results 1 to 5 of 5

Thread: Solved: Using IF command SUM copy paste special

  1. #1

    Solved: Using IF command SUM copy paste special

    Hi Here is the problem I have run into. I have in Column A a column of numbers. The same for Column B. In column C I am using the IF statement. =IF(B3>A3,"1","0"). If the number in column B is larger I get a
    1, if the number in column B is less I get a 0. Here is when the problem comes in. At the bottom of the column I want the SUM. The sum command
    will not work because the error message is stating that the 1 or 0 is a text and not a number. I can change the text to a number so the SUM command works by doing a copy paste special but then I loose the formula which I want to keep. My question is how do I keep the formula and get the SUM command to work. Thanks for any help with this one.
    Max

  2. #2
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Quote Originally Posted by Tenspeed39355
    ...The sum command will not work because the error message is stating that the 1 or 0 is a text and not a number...
    Greetings Max,

    Presuming you mean the worksheet function SUM, I don't get an error per se, but the results of the SUM are zero.

    I am afraid you lost me a bit when referring to pastespecial, but what would not work with =IF(B3>A3,1,0) ?

    Mark
    Last edited by GTO; 06-24-2009 at 08:51 PM.

  3. #3
    VBAX Regular
    Joined
    Jun 2008
    Posts
    72
    Location
    Get rid of the quotations in your formula.

    =IF(B3>A3,"1","0")

    should be

    =IF(B3>A3,1,0)

  4. #4
    Mark By removing the quotations took care of my problem. Thank you
    for your time with the problem. I will rate the thread *****
    Max

  5. #5
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Hey Max,

    Very happy to help,

    Mark

Posting Permissions

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