Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
=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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Subtracting Text from Number | Excel Worksheet Functions | |||
I need a formula for subtracting from a negative number | Excel Discussion (Misc queries) | |||
subtracting a constant number to all cells in the same column | Excel Discussion (Misc queries) | |||
Subtracting based on number of miles | Excel Discussion (Misc queries) | |||
Defining a number in a cell by text then subtracting it by the tex | Excel Worksheet Functions |