I have a spread sheet of values organized by id number with a column of semicolon separated values.
I would like the spread sheet to be organized by id number with a column for each value and if that value exists for a id number a 1 be placed in the cell and if it doesn't exist a 0 placed in the cell.
Has anyone done this before or know where I should start?
You can try this but you need to keep the original value somewhere and then use this formula:
=IF(ISERROR(SEARCH(C$1,$B2)),0,1)
Your data layout should be like below:
So Column B contains your original data and your new headers starts at Column C.
Enter the formula in C2 and copy to the rest of the cells. HTH.
Related
I need to get a list of unique values from few columns. The data looks like this:
I tried using Unique but it only gives me copy of the list. These 4 lists are already unique values found in another sheet.
If getting unique from 4 columns is impossible, how would I go around combining these 4 columns but instead merging data from a row to 1 cell I'd like to append that one column to have one city per row (so add more rows).
Another idea I had - pulling data from multiple sheets into 1 row, but as it's an automated report, number of towns in each sheet changes every time, so can't use specific cell locations.
You can use the following formula (entered into cell F2 and assuming your data is in range A1:D5)
=IFERROR(LOOKUP("zzzzz",INDEX(IF(COUNTIF(F$1:F1,A$2:D$5),0,A$2:D$5),MIN(IF(COUNTIF(F$1:F1,A$2:D$5),"",ROW(A$2:D$5)-ROW(A$2)+1)),0)),"")
As it is an array formula it needs to be entered using Ctrl+Shift+Enter and copied down until there are blank cells
It does not work in my case, in calc (LibreOffice) that i have exactly the same problem. To extract unique values from multiple columns with text, with blank spaces. I have tried a lot of formulas with no success...
What worked for me - I dont know why this worked for me!
A, B, and C contains text from the 2nd row and onwards. Formula is put on D2 cell as Array formula.
=IFERROR(IFERROR(IFERROR(
INDEX($A$2:$A$20; MATCH(0; COUNTIF($D$1:D1; $A$2:$A$20)+($A$2:$A$20=""); 0));
INDEX($B$2:$B$7; MATCH(0; COUNTIF($D$1:D1; $B$2:$B$7)+($B$2:$B$7=""); 0))
);
INDEX($C$2:$C$12; MATCH(0; COUNTIF($D$1:D1; $C$2:$C$12)+($C$2:$C$12=""); 0))
);
"")
Found here
So, I would like to return the contents of all rows where the value in column A is, let's say, 1.
My thought process is that I could use:
=INDEX(row_range,MATCH(1,A:A,0),0))
But Match will only return one value here, i.e. the number of the first row which contains a 1 in column A.
Is there a way of creating an array with the Match formula (thus returning the multiple row numbers, all of which contain '1' in column A) and then place that in the Index array so that it then runs through each of the Match-array values and creates a big long list of values in one array which I can then list out on a separate sheet?
Hope this makes sense...
Here is a demonstration of what I'm hoping for, if that helps! The idea would be that the array as shown would be created, which could then be extended down the column as per the part underneath.
https://i.stack.imgur.com/nCusM.png
Use the file you showed in your example (as "Sheet1") and put these formulas into indicated cells in Sheet2:
Into cell A2 put
=AGGREGATE(15;6;ROW(Sheet1!A:A)/((Sheet1!A:A=1)*1);ROW(A1))
this will give you all the rownumbers where value in A column of sheet1 equals 1.
Into cell B2 put
=COUNTA(INDIRECT("Sheet1!"&A2&":"&A2))-1
this will give you how many cells are filled in that row.
Into cell C2 put
=TEXTJOIN(",";TRUE;OFFSET(Sheet1!$A$1;A2-1;1;1;B2))
This will give you all the cells with data from that row concatenated. If you dont have this formula (first time in 2016 I believe) you can use OFFSET function to list the values in separate columns and then CONCATENATE them.
Copy these three down as many times as you want and into cell C1 put
=TEXTJOIN(",";TRUE;OFFSET(C2;0;0;COUNTIF(Sheet1!A:A;1);1))
The first 2 columns repeat data in my data export dump tab. I need to get the number of positions for a unique job reference. How can I create the third column?
In C2 put the following and drag down for as many rows as required
=IF(COUNTIF($A$2:$A2,A2)>1,"",B2)
I have two tables of data, call them table 1 and 2. In table 1 there is a long list of reference numbers. Each reference number has its own cell.
In table 2 I have the exact same reference numbers; however, in table 2 these reference numbers may or may not share that cell with another reference number. See below. The bottom three reference numbers in table 1 all share the same cell and are separated by a comma always.
Imagine table 1 and 2 are on separate tabs of the same workbook.
table 1 and 2
On the work sheet for table 1, I am trying to bring back the month found adjacent to the reference number in table 2. I am trying to take the value in table 1, search it in table 2, and return the month so that I get this result:
result in column b of table 1
I would like to avoid delimiting the values in the shared cells of table 2.
Thanks in advance for your help!
If your reference number are unique, you can get by with doing a wildcard vlookup
Assume you have a range in columns F and G where your reference numbers and months are. In Range A:B you want the values.
Essentially you are looking up like this.
If my value A1 is in column F and it matches a substring get the value from G
So you would use this formula in B1
=VLOOKUP(CONCATENATE("*", A1, "*"),$F$1:$G$6,2, FALSE)
what this is doing is, get the value from A1, and match the range of F:G where the first column CONTAINS A1, get the value from the corresponding G column
From there copy paste the formula for the rest of the
cells in B column
I have some data that's structured in a table like this:
.
I have another tab on my spreadsheet where I eliminate any duplicate category entries and want to concatenate the data to look like this:
I need to create this using a function and not a macro or Visual Basic. I've already written the function to eliminate any of the duplicate category entries and now I need to figure out how to take each of those unique categories and append the data behind it. Any ideas?
Assuming the first image comes from Sheet1 and the second Sheet2, here's a way to do it. You need to add at least one calculated column to Sheet1 and optionally two calculated rows to Sheet2.
Uniquely identify each row on Sheet1. Add a new column A with the formula =B3&COUNTIF($B$3:B3,B3) in A3 and fill down. You'll have first1 in A3, first2 in A4 and so on.
Identify each block of columns on Sheet2. Add a new row 6 with the formula =COUNTIF($B$2:B2,B2) in B6 and fill across. The values will be 1,1,1,2,2,2,3,3,3. You can type these in manually if you like but it won't scale as easily.
Work out the column of each data item in Sheet1 and put in the columns for Sheet2. Add a new row 7 to Sheet2 with the formula =MATCH(B2,Sheet1!$A$2:$E$2,0) and fill across. The values will be 3,4,5,3,4,5,3,4,5. We now know, for each cell in Sheet2, which instance of the category we have and in which column the data variable comes from.
Use VLOOKUP to find first1 and return data column 3 within the data table. On Sheet2, set cell B3 to =VLOOKUP($A3&B$6,Sheet1!$A$2:$E$8,B$7,FALSE) and fill down and across.
You'll have a number of #N/A errors (e.g. cell E4). If you have a newer version of Excel, you can use IFERROR() to escape this; otherwise, use =IF(ISNULL(<formula>), "", <formula>) where <formula> is the formula in step 4.
To summarise:
Create a unique, sequential, calculable row ID for each row in the source.
Determine which instance of that sequence is used by each column in the destination. This is appended to the end of the category to determine the row IDs formed in the previous step.
Determine which column contains the data for each column in the destination.
Look up the row with the calculated row ID and find the relevant column for this data item.
Format the results appropriately.