+ Reply to Thread
Results 1 to 5 of 5

Column with text "On" or "Off" want to make 0 or 1.

  1. #1
    Registered User
    Join Date
    01-03-2014
    Location
    Southern California
    MS-Off Ver
    Excel 2010
    Posts
    1

    Column with text "On" or "Off" want to make 0 or 1.

    Basically the title. I want to plot time of day over several days, versus whether a machine is "on" or "off". I want to convert the "on" and "off" terms into 0 or 1.

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Column with text "On" or "Off" want to make 0 or 1.

    without a sample is a guessing game but assuming there are two columns date and state of the machine in columns A and B respectively I would suggest another column C with a =if(B..="on",1,0) and copy it all the rest of the data rows.

  3. #3
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    604

    Re: Column with text "On" or "Off" want to make 0 or 1.

    You could select the On/Off column, press Ctrl+H... search and replace all On's with 1's and Off's with 0's

  4. #4
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Column with text "On" or "Off" want to make 0 or 1.

    Hi Will,

    Welcome to the forum!

    Are you comfortable with a "helper" column to give you the 0s and 1s?

    Suppose A1 = "Off" In B1 type =(A1 <> "Off")*1 This assumes that Off is 0 and On is 1. Otherwise, reverse the logic.

    There are many other ways to do this with a helper column!

    Regards, David



    When you reply please make it clear WHO you are responding to by mentioning their name.
    If this has been of assistance, please advise. A little thanks goes a long way.
    - Please click on the *Add Reputation button at the bottom of helpful responses.
    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".

  5. #5
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,656

    Re: Column with text "On" or "Off" want to make 0 or 1.

    =--(A1="on")
    or try this one
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] If there is any text in column "A$" on "sheet1" then move cell to column "A$" on "sheet2"
    By ckgeary in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2013, 08:28 PM
  2. Replies: 2
    Last Post: 06-06-2013, 12:45 PM
  3. How can i copy value from "HTMLText"(EMBED("Forms.HTML:Text","")),using Macro
    By andrewyang in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2010, 12:47 AM
  4. [SOLVED] If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ...
    By Maria J-son in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2006, 08:25 AM
  5. [SOLVED] How do I split "A1B2" into "A1" and "B2" using text to column fun.
    By Jennifer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2005, 06:06 PM

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