Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

How do I find all nonzero values in an excel spreadsheet?

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » The DU Lounge Donate to DU
 
alarimer Donating Member (1000+ posts) Send PM | Profile | Ignore Sun Nov-11-07 01:29 PM
Original message
How do I find all nonzero values in an excel spreadsheet?
And then replace them with 1? I have searched the web and not been able to come up with a way to do this. What I want is to replace the nonzero values with 1 to get a presence/absence data set. It is a huge file (4146 rows by 41 columns) so doing them one at a time is tedious at best.

But I can't seem to put any value in the find box. I tried things like >1 but that does not work. I am at a loss. The Microsoft website is unhelpful.
Printer Friendly | Permalink |  | Top
Fredda Weinberg Donating Member (1000+ posts) Send PM | Profile | Ignore Sun Nov-11-07 01:41 PM
Response to Original message
1. VBA script for automation
you'll see a formula ... it starts w/ the = sign

then you'll want to replace

here's instructions

http://techonthenet.com/excel/formulas/replace.php
Printer Friendly | Permalink |  | Top
 
alarimer Donating Member (1000+ posts) Send PM | Profile | Ignore Sun Nov-11-07 01:51 PM
Response to Reply #1
2. Thanks but that isn't quite the right thing
Edited on Sun Nov-11-07 01:56 PM by alarimer
There is a Find and Replace function that should work but I can't figure out how to make it do what I want. I even used conditional formatting to change the color and then tried to find it by that but it keeps telling me it can't find anything.

I don't see an option to specify all values >0.
Printer Friendly | Permalink |  | Top
 
TAZller Donating Member (118 posts) Send PM | Profile | Ignore Sun Nov-11-07 02:17 PM
Response to Original message
3. Array formula...
Select an adjacent area of exactly the same dimensions then type the formula ENTERING USING CTRL+SHIFT+ENTER..... if($a$1:$$>0,1,0). Then copy....paste special.....values over the source numbers....
Printer Friendly | Permalink |  | Top
 
Fredda Weinberg Donating Member (1000+ posts) Send PM | Profile | Ignore Sun Nov-11-07 02:28 PM
Response to Original message
4. try this
Printer Friendly | Permalink |  | Top
 
Zorro Donating Member (1000+ posts) Send PM | Profile | Ignore Sun Nov-11-07 02:29 PM
Response to Original message
5. Probably 2 steps
1. Replace all cells with a zero to a blank.

2. Then replace all non-zero cells with a 1. Use the wildcard "*" to represent what you're replacing with a 1.
Printer Friendly | Permalink |  | Top
 
alarimer Donating Member (1000+ posts) Send PM | Profile | Ignore Sun Nov-11-07 02:37 PM
Response to Reply #5
6. I need the zeros in there though
I don't know how to find nonzero values in the first place. The wildcard does not seem to work. I put in the asterisk and it tells me nothing was found.
Printer Friendly | Permalink |  | Top
 
Zorro Donating Member (1000+ posts) Send PM | Profile | Ignore Sun Nov-11-07 06:13 PM
Response to Reply #6
7. Variation on the theme
1. Duplicate the workheet.

2. On worksheet version 1, change all cells that are zero to blanks. (Enter 0 in the replace box, leave the second box blank, and replace all.)

3. On worksheet version 1, change all cells with anything to 1. (Enter * in the replace box, enter 1 in the second box, and replace all.)

4. Select and copy version 1 worksheet.

4. Paste Special worksheet 1 into worksheet 2, but check the box "skip blanks". This should do it, if I understand the problem you're trying to solve.
Printer Friendly | Permalink |  | Top
 
alarimer Donating Member (1000+ posts) Send PM | Profile | Ignore Sun Nov-11-07 06:23 PM
Response to Reply #7
8. What I ended up doing is using a wildcard *
First I did find and replace for 1*, then 2*, all the way through 9. It seemed to work and wasn't too time consuming.

Thanks, though.
Printer Friendly | Permalink |  | Top
 
DU AdBot (1000+ posts) Click to send private message to this author Click to view 
this author's profile Click to add 
this author to your buddy list Click to add 
this author to your Ignore list Wed Apr 24th 2024, 06:37 AM
Response to Original message
Advertisements [?]
 Top

Home » Discuss » The DU Lounge Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC