+ Reply to Thread
Results 1 to 2 of 2

Can't sum numbers from result of If statement

  1. #1
    Registered User
    Join Date
    07-04-2011
    Location
    Portland, Oregon
    MS-Off Ver
    Excel 2003
    Posts
    7

    Post Can't sum numbers from result of If statement

    I'm using the following formula to check and see if a cell contains certain text:

    =IF(ISNUMBER(SEARCH("100m Pred",D4)),"1"," 0")

    If it the text is there it puts a 1, if not, a 0. However, when I try to sum a column of these ones and zeros, the answer is always 0 because the numbers are not being recognized. I tried formatting all the cells as numbers, but that did not solve the problem.


    EDIT: Turns out the quotation marks around the numbers were the problem. Whoops.
    Last edited by Greg_2; 07-14-2011 at 10:14 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,053

    Re: Can't sum numbers from result of If statement

    Yes. If you put "" around number you will get text and not number.

    If, from some other result you get number as text you can also convert it back to number by for example adding 0 or multiplying by 1.... (="1"+0)

    However, this will give you error if result is some other text as ="a"+0
    Never use Merged Cells in Excel

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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