How to reverse code data (1=5, 2=4, etc.)?

J

jhk150

I have data sets in only certain columns of my spread sheet that need to be
reverse coded, i.e. 1=5, 2=4, 3=3, 4=2, 5=1 . How do I get these new values
in Excel?
 
B

BobT

If the data is sorted (or can be) by the column with those numbers, then:

1. Sort the records by the column with numbers that need changing. This
will get all of the 1's together, and all the 2's together, etc.
2. Then highlight the 1's.
3. Press 5 then CTRL+ENTER. This places a 5 in all of the cells that had a
1.
4. Repeat for the other numbers that need to be swapped.
5. Resort if needed after all the changes are made.
 
J

jhk150

I am not able to sort the values because the data would not correspond with
the row with the respondent's ID number. Is there anything else I can do?
 
S

Sheeloo

Can you select the values you want to change? If yes then do the following;

1. Enter -6 in any unused cell
Edit->Copy
Select the cells you want to change
Edit->Paste Special->Add

2. Enter -1 in any unused cell
Edit->Copy
Select the cells you want to change
Edit->Paste Special->Multiply

Alternatively enter this next to the column which has the values you want to
change;
(assuming Col A, enter this in B1 and copy down)

=IF(AND(A1>0,A1<6),(6-A1),A1)

You can then Copy the Col, do Edit->Paste Special->Values and then delete 0s.
 
M

Mike Middleton

jhk150 -

If you have one row for each respondent, then you can use Data | Sort with
the desired column as the sort key. Each row will remain intact. Make a
backup copy of the worksheet first.

- Mike Middleton
http://www.DecisionToolworks.com
Decision Analysis Add-ins for Excel
 
S

Stefi

Your data being in column A
=MAX(A:A)-A1+1
formula in a helper column reverses column A values.

Regards,
Stefi

„jhk150†ezt írta:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top