Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Subtracting Text from Number

I am working in a large spreadsheet and need to be able to subtract to
columns without adding any new columns or using subtotals. If I have words
and numbers in the columns, ex. "none", is there a function that will
eliminate the "value" error message when I subtract (ex. 9-none = value, but
i want none or any text to be viewed as zero)?

Ex. of how it is currently (not) working
none - 9 = value (wrong)
12 - 9 = 3 (right)

Ex. of how I would like for it to work
none - 9 = -9 (right)
12 - 9 = 3 (right)
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default Subtracting Text from Number

I am working in a large spreadsheet and need to be able to subtract to
columns without adding any new columns or using subtotals. If I have
words
and numbers in the columns, ex. "none", is there a function that will
eliminate the "value" error message when I subtract (ex. 9-none = value,
but
i want none or any text to be viewed as zero)?

Ex. of how it is currently (not) working
none - 9 = value (wrong)
12 - 9 = 3 (right)

Ex. of how I would like for it to work
none - 9 = -9 (right)
12 - 9 = 3 (right)


Assuming for this example that your data is in A1 and B1 and C1 is your
subtraction column... use this formula in C1...

=IF(A1="none",0,A1)-B1

If B1 could also have "none" in it, then use this...

=IF(A1="none",0,A1)-IF(B1="none",0,B1)

Note that the comparisons will be case sensitive.

Rick

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default Subtracting Text from Number

You need to use an if function: if None could be in cell A3:

=IF(ISNUMBER(A3),A3,0) - 9

If you have a lot of words that equal certain values, then you could create a table

None 0
One 1
Two 2
Some 4
Many 100

use

Vlookup(A3,TableRange,2,False)

in place of the 0 in the first formula.

HTH,
Bernie
MS Excel MVP


" wrote in message
...
I am working in a large spreadsheet and need to be able to subtract to
columns without adding any new columns or using subtotals. If I have words
and numbers in the columns, ex. "none", is there a function that will
eliminate the "value" error message when I subtract (ex. 9-none = value, but
i want none or any text to be viewed as zero)?

Ex. of how it is currently (not) working
none - 9 = value (wrong)
12 - 9 = 3 (right)

Ex. of how I would like for it to work
none - 9 = -9 (right)
12 - 9 = 3 (right)



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Subtracting Text from Number

Does this do what you want?

=IF(ISERROR(A1-B1),B1*-1,A1-B1)

Mike

" wrote:

I am working in a large spreadsheet and need to be able to subtract to
columns without adding any new columns or using subtotals. If I have words
and numbers in the columns, ex. "none", is there a function that will
eliminate the "value" error message when I subtract (ex. 9-none = value, but
i want none or any text to be viewed as zero)?

Ex. of how it is currently (not) working
none - 9 = value (wrong)
12 - 9 = 3 (right)

Ex. of how I would like for it to work
none - 9 = -9 (right)
12 - 9 = 3 (right)

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 252
Default Subtracting Text from Number

=IF(ISNUMBER(A1),A1,0)-IF(ISNUMBER(B1),B1,0)

" wrote:

I am working in a large spreadsheet and need to be able to subtract to
columns without adding any new columns or using subtotals. If I have words
and numbers in the columns, ex. "none", is there a function that will
eliminate the "value" error message when I subtract (ex. 9-none = value, but
i want none or any text to be viewed as zero)?

Ex. of how it is currently (not) working
none - 9 = value (wrong)
12 - 9 = 3 (right)

Ex. of how I would like for it to work
none - 9 = -9 (right)
12 - 9 = 3 (right)



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default Subtracting Text from Number

First of all, are you using "legal" XL formulas?

=12-9

=none-9

If you're using the above type of syntax, then you *can* assign values to
words, or ... more precisely ... assign names to values.

To label zero as "none",
<Insert <Name <Define

In the "Names In Workbook" box on top, type
none
In the "Refers To" box at the bottom, change whatever's there to:
=0
Then <OK

NOW, in any cell, enter:
=none
And you'll see a return of 0.

If you enter this formula in a cell:
=none-9

You'll get your return of
-9

You can also assign names to formulas.
Say you wanted "all" to mean the total of A1 to A5.

Use the above procedure, entering
all
in the "Names In Workbook" box,
And, in the "Refers To" box, enter:
=Sum($A$1:$A$5)

Now, with A1 to A5 containing 1 to 5 respectively, enter
=all
in any cell, and get a return of 15.

You can now use a formula something like this:
=none-9+all
to get a return of 6.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------


" wrote in message
...
I am working in a large spreadsheet and need to be able to subtract to
columns without adding any new columns or using subtotals. If I have
words
and numbers in the columns, ex. "none", is there a function that will
eliminate the "value" error message when I subtract (ex. 9-none = value,
but
i want none or any text to be viewed as zero)?

Ex. of how it is currently (not) working
none - 9 = value (wrong)
12 - 9 = 3 (right)

Ex. of how I would like for it to work
none - 9 = -9 (right)
12 - 9 = 3 (right)



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,718
Default Subtracting Text from Number

Assume A1 and B1 either have text or positive value

=MAX(A1,0)-MAX(B1,0)


" wrote:

I am working in a large spreadsheet and need to be able to subtract to
columns without adding any new columns or using subtotals. If I have words
and numbers in the columns, ex. "none", is there a function that will
eliminate the "value" error message when I subtract (ex. 9-none = value, but
i want none or any text to be viewed as zero)?

Ex. of how it is currently (not) working
none - 9 = value (wrong)
12 - 9 = 3 (right)

Ex. of how I would like for it to work
none - 9 = -9 (right)
12 - 9 = 3 (right)

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subtracting Text from Number [email protected] Excel Worksheet Functions 4 June 1st 07 07:02 PM
I need a formula for subtracting from a negative number Pat Excel Discussion (Misc queries) 3 May 26th 07 12:57 PM
subtracting a constant number to all cells in the same column gimianame Excel Discussion (Misc queries) 2 August 11th 05 07:59 PM
Subtracting based on number of miles Ms Chewie Excel Discussion (Misc queries) 3 December 21st 04 05:35 AM
Defining a number in a cell by text then subtracting it by the tex Crowraine Excel Worksheet Functions 1 December 16th 04 07:49 AM


All times are GMT +1. The time now is 04:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"