> It's up to you to make sure your data is what it should be--numbers treated as
> text or treated as numbers.
Absolutely. The problem is: how do I achieve this if Excel does not
let me set and enforce data types for the fields, the way I would do
in any database? I can change the formatting, but that would only
change the way the content is displayed, not the content itself.
> You can preformat cells as Text and do your data entry and the values in those
> cells will be text--even if they look like numbers.
I never do manual data entry myself, nor do I have any intention to.
I usually receive my files from other people and/or retrieve them from
the company's IT systems.
Let's say I have an Excel spreadsheet with two worksheets, each
containing customer codes. Let's say code 123 is present in both. How
do I know whether that 123 is treated by Excel as text or number? In a
database, I would know the data type of the field, but not in Excel!
> [...]
> And if I have to convert text numbers to number numbers, then I'd use this:
[quoted text clipped - 4 lines]
>
> (Using xl2003 menus)
Your tips are very helpful, but everything seems to suggest that, as I
always thought, Excel is a very poor tool for data analysis; for this
type of stuff, databases are much faster, reliable, and it's way way
more straightforward to audit the whole process: if I type a few lines
of SQL code, I know beyond any doubt what I did and what I didn't,
whilst, if I open an Excel file I created a while ago, or that someone
else created, I can never be 100% sure that the data cleansing was
done correctly on all columns, all rows, etc. Would you agree with
this opinion or is there something about spreadsheets vs databases I'm
just missing?
> Debra Dalgleish has some more notes on trouble shooting these kinds of >ormulas:http://www.contextures.com/xlFunctions02.html#Trouble
Thanks a lot!
PS don't get me wrong: I'm mad at Excel, certainly not at the people
who are trying to help me in this forum! ;)
Dave Peterson - 04 Mar 2008 21:23 GMT
You can complain about how excel allows the user to have complete control over
the value in each cell. It's not a database program.
I offered a few ways to do the data entry and to convert text to numbers and
numbers to text. I don't understand your question about how you can achieve
this.
If the people who send you the file aren't careful how they do the data entry,
then you'll have to fix the data yourself--well, if it's important to you.
You can use formulas to return the quantity of entries in a range:
=counta(a:a)
and another formula to count the quantities of numbers:
=count(a:a)
If they don't match, then you know you have some non-numeric entries.
On an individual cell basis, you can use:
=isnumber(a1)
and
=istext(a1)
I know if I find using some other tools more effective, then I'd use some other
tool.
> > It's up to you to make sure your data is what it should be--numbers treated as
> > text or treated as numbers.
[quoted text clipped - 40 lines]
> PS don't get me wrong: I'm mad at Excel, certainly not at the people
> who are trying to help me in this forum! ;)

Signature
Dave Peterson