+ Reply to Thread
Results 1 to 4 of 4

Replacing Xs with 1s or 0s

  1. #1
    Registered User
    Join Date
    10-10-2014
    Location
    Newark, DE
    MS-Off Ver
    Home and Student 2013
    Posts
    4

    Replacing Xs with 1s or 0s

    I have a large spreadsheet of a 10-min bird survey data, where each survey minute has a column. Each row is a species observation. Right now, for some species, there are Xs under each minute column where a species was detected. I would like to change the first X in each row to a 1, and all subsequent Xs in that row to 0s. is there an IF function I could use to do this? Thanks! example.xlsx

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Replacing Xs with 1s or 0s

    Try this one in C3 and pull formula to the right

    =IF(AND(C2="X",COUNTIF($C2:C2,"X")=1),1,0)
    Last edited by AlKey; 01-16-2015 at 11:32 AM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Replacing Xs with 1s or 0s

    Hi,

    Find the attached with a macro to do what I think you want. The code looks like this:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    10-10-2014
    Location
    Newark, DE
    MS-Off Ver
    Home and Student 2013
    Posts
    4

    Re: Replacing Xs with 1s or 0s

    The macro worked very well; thanks so much!

+ 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. Replacing cell value without replacing formula in the cell
    By kingoftheace in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-17-2012, 06:28 AM
  2. Replacing Value <=250 to 0
    By Locust in forum Excel General
    Replies: 4
    Last Post: 05-05-2011, 05:20 PM
  3. replacing a value
    By 911 in forum Excel General
    Replies: 3
    Last Post: 11-23-2010, 02:27 AM
  4. [SOLVED] Replacing
    By Ozgur Pars in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2006, 02:25 AM
  5. [SOLVED] Replacing #N/A with a '0' (zero)
    By neilcarden in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-19-2005, 09:06 AM

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