+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    01-29-2010
    Location
    Oklh, US
    MS-Off Ver
    Excel 2007
    Posts
    6

    How to change a text to number in the IF function value

    Hi,
    I am using an IF function to test if a condition is true or false in Excel 2007.

    =IF ( logical_test, value_if_true, value_if_false )
    The value that I want to put if condition is true is '1' and if false is '0'. I would like to do a total of all the 1s in the column, however this value is saved as text instead of a number and I unable to do the sum.

    Is there a way to change the value from number to text.

    I appreciate any help.

    Stan

  2. #2
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    5,213

    Re: How to change a text to number in the IF function value

    Hi Stan,

    In your IF function, be sure to not put the 1 or 0 in quotes. For example:

    =IF(B10="cat",1,0)

    Not

    =IF(B10="cat","1","0")

    Also, if that's not possible to reconcile, you can select your range of 1's and 0's that are formatted as text, then on the Data tab click Text-to-Columns and immediately click Finish. (Make sure those cells are formatted as General or Number, not Text - on the Home tab).

    Hope that helps.

  3. #3
    Registered User
    Join Date
    01-29-2010
    Location
    Oklh, US
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: How to change a text to number in the IF function value

    Hey Paul, that worked just perfect. Thank you so much. Sure enough I had my 1s and 0s in quotes. Appreciate it!!

    Stan

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.2.0