CHALLENGE: Why can Excel still perform calculations on numbers stored as text???

theexcellife

New Member
Joined
Dec 10, 2017
Messages
1
Whether I convert a number to "text" format, or use the apostrophe to indicate a text string that consists of numbers, I can still perform calculations on those strings. Why is that?

Even crazier, I changed the number converted to "text" format to a string of letters, and my IF function still executed the logical argument which checked to see if it was greater than 0!

Anyone?
 
Last edited by a moderator:

Some videos you may like

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

jtakw

Well-known Member
Joined
Jun 29, 2014
Messages
5,492
Office Version
  1. 2016
Platform
  1. Windows
Hi,

Text is actually stored/represented by numbers within Excel, that's why there are functions you can use to include/exclude certain values, see examples below:
Someone else here may be able to explain this to you in more detail.

<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th><th>C</th><th>D</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style=";">text</td><td style="text-align: right;;">TRUE</td><td style="text-align: right;;">FALSE</td><td style="text-align: right;;">TRUE</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style="text-align: right;;">123</td><td style="text-align: right;;">TRUE</td><td style="text-align: right;;">TRUE</td><td style="text-align: right;;">FALSE</td></tr></tbody></table><p style="width:4.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B1</th><td style="text-align:left">=A1>0</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">C1</th><td style="text-align:left">=ISNUMBER(<font color="Blue">A1</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">D1</th><td style="text-align:left">=ISTEXT(<font color="Blue">A1</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B2</th><td style="text-align:left">=A2>0</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">C2</th><td style="text-align:left">=ISNUMBER(<font color="Blue">A2</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">D2</th><td style="text-align:left">=ISTEXT(<font color="Blue">A2</font>)</td></tr></tbody></table></td></tr></table><br />
 
Last edited:

Macropod

Retired Moderator
Joined
Aug 27, 2007
Messages
3,514
Whether I convert a number to "text" format, or use the apostrophe to indicate a text string that consists of numbers, I can still perform calculations on those strings. Why is that?
Changing the formatting doesn't change the content; you could just as easily change the format to a date and still evaluate it as a number.
Even crazier, I changed the number converted to "text" format to a string of letters, and my IF function still executed the logical argument which checked to see if it was greater than 0!
You seem to be working from the false premise that IF tests can't evaluate strings - or at least numbers formatted as strings. Suppose you input the formula:
=IF(A1<>0,1,0)
into B1. If A1 is empty, the result in B1 will be 0; if A1 contains any text or non-zero number, the result will be 1.
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
Whether I convert a number to "text" format, or use the apostrophe to indicate a text string that consists of numbers, I can still perform calculations on those strings. Why is that?

Even crazier, I changed the number converted to "text" format to a string of letters, and my IF function still executed the logical argument which checked to see if it was greater than 0!

Anyone?

A text value is always greater than a number:

Let A1 house '1.

In B1 enter:

=A1>10

This should give TRUE as designed.
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,123,481
Messages
5,601,918
Members
414,482
Latest member
morkar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top