How to apply template in Automatic Recode in SPSS? - statistics

I have saved template (`.sat) file, but cannot apply it. When I apply it, the OK button is still disabled. Please see the image:
Could this be because of the trial version?
Thanks.

If you're within the 14-day trial period, you have everything available to you, so it isn't the license.
1). A common mistake is to forget to fill in the "New Name" field. Make sure you have done that and clicked 'Add New Name'. Until you do, OK is disabled.
2). Apart from that, if you haven't tried in syntax, then could you please start the program and try something like this:
DATA LIST FREE /x (F1) a (A1).
BEGIN DATA.
1 a 2 b 3 c 4 d 5 e
END DATA.
DATASET NAME data1.
AUTORECODE VARIABLES=a /INTO na
/SAVE TEMPLATE='<your path>/template.sat'
/PRINT.
DATA LIST FREE /y (F1) a (A1).
BEGIN DATA.
1 a 2 e 3 d 4 a 5 c 6 b 7 c 8 e 9 g 10 z
END DATA.
DATASET NAME data2.
DATASET ACTIVATE data2.
AUTORECODE VARIABLES=a /INTO na
/APPLY TEMPLATE='<your path>/template.sat'
/PRINT.
If you get an error with AUTORECODE then there is a problem with your installation; please reply with whatever the error message is.

Related

Find all values in Column A which are present in Column B

Consider the sheet below:
A
B
1
4
3
5
2
2
5
0
4
1
I want to find if there is a match for each row of column 1 with any row of column 2. So ideally this would give me:
A
B
C
1
4
Yes
3
5
No
2
2
Yes
5
0
Yes
4
1
Yes
As a first and simple step, I am using =MATCH(A2,B2:B6) to get the index of the match and then manually calling this across the rows to get something like this:
A
B
C
1
4
6
3
5
-
2
2
3
5
0
2
4
1
1
I am now having a problem:
I want to apply this for a row of 500 in A and 2000 in B. I was thinking of manually filling in the first few rows and then select and drag over the first 500 rows. This however does not work as for each subsequent cell, it just changes the formula to =MATCH(A(N +1),B2 + N:B6 + N) which gives me wrong values and at worst, just repeats the older pattern ahead.
Can anyone help me with how I can just use the MATCH function to find all the values in A that are present in B?
Let me continue where you arrived:
=MATCH(A2,B2:B6,0)
(You forgot the last zero)
This formula is correct, but it is also wrong.
???
Well, when you drag it down, you get:
=MATCH(A3,B3:B7,0)
This is not what you want: you want the search term (A2) to change into A3 but you want the search array (B2:B6) not to change. In order to get this done, you need to work with absolute references. This looks like this:
=MATCH(A2,B$2:B$6,0)
When you drag this down, this is what you get:
=MATCH(A3,B$2:B$6,0)
=> ok so far.
Problem now: you need to translate your current results (a number or #N/A) into "yes" or "no". This can be done in numerous ways, let me give you an example:
=IF(ISERROR(MATCH(A2,B$2:B$6,0)),"No","Yes")
One remark: there exists an IFERROR() function in Excel, but this does not have an "else"-clause, hence the choice for the IF(ISERROR( combination.
Within Sheets you may try this out:
=index(if(len(A2:A),if(ifna(xmatch(A2:A,B2:B)),"Yes","No"),))
If you want to separate those matching values then could use FILTER() function.
=FILTER(A1:A5,COUNTIFS(B1:B9,A1:A5))
And for YES, NO dynamically, try MAP() function.
=MAP(A1:A5,LAMBDA(x,ISNUMBER(XMATCH(x,B:B))))

Excel removing all rows where the first, last, and email are all the same

I'm struggling over how to remove certain rows in my excel sheet. Right now I have something like this:
https://i.stack.imgur.com/c5Pxi.png
First Last Email Amount
A B AB#gmail.com $25
A B AB#gmail.com $25
A B AB#gmail.com $25
A B AB#gmail.com $25
Z Y AB#gmail.com $10
1 2 12#gmail.com $50.00
1 2 12#gmail.com $50.00
3 4 12#gmail.com $50.00
Qwerty Uiop Qwerty#gmail.com 50
Qwerty Uiop Qwerty#gmail.com 50
Qwerty Uiop Qwerty#gmail.com 50
Qwerty Uiop Qwerty#gmail.com 50
I want to know how i can analyze this data and delete all people who have only entered the same first and last name and email for all of their transactions. For example, in this image, Qwerty#gmail.com has 4 transactions, but they all have the same first and last name, so i want to delete all rows containing qwerty#gmail.com. However, AB#gmail.com has 4 transactions with the name A B and 1 transaction with the name Z Y, so i don't want to remove any rows containing AB#gmail.com.
Can anyone help suggest a way this could be done?
Excel has a built-in facility for removing Duplicate values.
Select the range of cells containing the data
On the Data tab click Remove Duplicates
Under Columns, select the columns you wish to include in the check for duplicates
Click OK
After the message saying how many records will be removed, Click OK
You can use the Advanced Filter with a formula criteria.
The formula:
A2: =COUNTIFS(Sheet3!$C$8:$C$19,C8,Sheet3!$A$8:$A$19,A8,Sheet3!$B$8:$B$19,B8)/COUNTIF(Sheet3!$C$8:$C$19,C8)<>1
Before
Filter Dialog
After

excel map values to same key column

From a text file i copy 10 lines of text in the format productName#qty.
First time around it could be in the following order. I paste this onto excel and separate the data by #
A#10 -> A 10
D#25 -> D 25
Second time around it could be in the following order. I do the same as before.
B#10 -> B 10
A#12 -> A 12
I want to merge the 2 sets of data and want the output to be something like this
A 10 12
B 10
D 25
Any help on how to do this. I don't know programming or macros, so any detailed description will be greatly appreciated.
Add a column for 'time around' and create a PivotTable with that for COLUMNS, Product for ROWS and Sum of Qty for Sigma VALUES:

Excel - get the highest number in a certain column, that contains text

I have these two sheets, that I'm using to keep track of my work. In one of the sheets, I have my overview, where I can see all of my tasks at hand. In other sheets, I have the different jobs I'm currently doing.
Now... I'm looking for at formula for Microsoft Excel, where I can do the following:
="GET THE HIGHEST ROW-NUMBER, IN A CERTAIN COLUMN, THAT ISN'T EMPTY, AND PUT THE TEXT FROM THAT COLUMN INTO ANOTHER CELL" (see examples of it further down)
Examples:
Let's say, that I insert this formula into D10, and to check the entire A-column, then this would be the result
Ex.1
A B C D
1 Foo
2 Bar
3 Is
4 An
5 Apple
6 From
7 Chile
8
9
10 Chile
Ex.2
A B C D
1 Foo
2 Bar
3 Is
4 An
5 Apple
6
7
8
9
10 Apple
Ex.3
A B C D
1 Foo
2 Bar
3 Is
4
5
6
7
8
9
10 Is
Ex.4
A B C D
1 Foo bar is
2 Also an
3 Egyptian God
4 Of pie
5
6
7
8
9
10 Of pie
On a last remark... Then I'm using this stupid danish version of Excel, so if you're a dane trying to solve this, then a danish formula would be 'B-E-A-UTIFUL'.
And remember, that it has to work across different sheets.
MY ATTEMPTS:
I Google around for about an hour... I found this, which I tried to understand:
=INDIRECT(CONCATENATE("R",MATCH(MAX(S4:S5),S4:S5,0)+3))
But I couldn't get it to work, because of this stupid danish Excel. I tried to understand it, then - and figured out, that it parsed and concatenated area as text and inserted that into the field - so I guess that wouldn't do the trick anyways.
Then my idea was to try to loop through all the cells in a column and check each of the cells, if they weren't empty, and if their row-number where higher than then previous. I quickly gave up on that one, because I couldn't find a way to make a for loop in Excel.
Then I've tried all other sorts of things (mainly experimenting with the MAX()-function).
If your data is in a sheet called data then try this formula to get the last text value in column A of that sheet
=LOOKUP(REPT("z";255);Data!A:A)
In Danish that should be
=SLĂ….OP(GENTAG("z";255);Data!A:A)

Excel Cluster Bar(or Column) Chart

my data looks some thing like this:
Name Event Result
Bob 1 0
Mary 1 1
Sue 2 0
Tom 1 0
Dick 2 1
Harry 1 1
Mary 2 0
Sue 2 1
Dick 1 1
etc...
Names repeat, Event is the Event type, and Result is whether the event was successful or not (0, 1). What I want to end up with is a cluster bar chart with four bars to each name:
Event 1 # of Success
Event 1 # of Fail
Event 2 # of Success
Event 2 # of Fail
I figure I'll probably want to put this in a clustered stacked bar in the future, but if I can get the simple cluster going I can figure it out. A link to a good tutorial on event based charts would be appreciated. I'll keep searching and post back what I find. Thanks in advance!
Not Sure if this will fit your needs compleately, but it might be the quickest way to visualize the data:
Select your posted data, go to insert-tab, select pivot-chart (hides behind pivot-table) and insert it as a new sheet.
Then put the Event and the Result columns to the row-field and again the Event column to the value-field and set it up to use count instead of sum. Then you get the result beneath.

Resources