English 中文(简体)
Between a range of values in excel 2007
原标题:

I have a column of numbers in Excel 2007, for example:

19
35
29
62

What i want to do is: If the value is between 0-20 replace the value with 0.1
If the value is between 20-25 replace it with 0.2

The bin sizes are not going to be the same (0-20, 20-25, 30-50, 50-60, 65+) etc, and the values to replace the numbers with are not necessarily going to be sequential.

Is there a formula for this? Could a macro work? It would take forever with a find and replace.

Thanks

最佳回答

Simplest: a table on a sheet, two columns, one for lower bounds of bands and one for respective values:

 0  0.1
20  0.2
25  0.3
30  0.4
50  0.5
60  0.6

Then the formula: =VLOOKUP(value_to_replace,table_address,2,TRUE)

Make sure bounds are sorted or the trick will not work. Replacement values do not have to be sorted.

问题回答

暂无回答




相关问题
import of excel in SQL imports NULL lines

I have a stored procedure that imports differently formatted workbooks into a database table, does work on them then drops the table. Here is the populating query. SELECT IDENTITY(INT,1,1) AS ID ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

Excel date to Unix timestamp

Does anyone know how to convert an Excel date to a correct Unix timestamp?

C# GemBox Excel Import Error

I am trying to import an excel file into a data table using GemBox and I keep getting this error: Invalid data value when extracting to DataTable at SourceRowIndex: 1, and SourceColumnIndex: 1. As ...

Importing from excel "applications" using SSIS

I am looking for any tips or resources on importing from excel into a SQL database, but specifically when the information is NOT in column and row format. I am currently doing some pre-development ...

热门标签