How to distribute data in google sheet? - google-sheets
I have a data as follows - ABCDEFGHIJKLMNOPQRSTUVWXYZ
I am coping these data into google sheet - resultant will be - all the data will be copied in one cell.
Cell01
ABCDEFGHIJKLMNOPQRSTUVWXYZ
How i can distribute data in a way that each cell contains one alphabet?
cell01 | cell02 | cell03 | cell04 | cell05 | cell06 |cell07 | cell08 | cell09 | cell10 |cell11
A | B | C | D | E | F | G | H | I | J | H
How do i do that?
With the ABC... string in cell A1, use this in column A of a free row:
=split(regexreplace(A1, "(.)", "$1µ"), "µ")
Related
Conditionally CONCAT based on helper column data using ARRAYFORMULA in Google Sheets
I have 2 columns of names (Name 1, Name 2) which I would like to concat into a single column. [CURRENT DATA SET] [FORMULA - CONCAT] | A | B | | D | | Name1 | Name2 | | Name1_Name2 | | Name3 | Name4 | | Name3_Name4 | | Name5 | Name6 | | Name5_Name6 | This portion is working using my ARRAYFORMULA: =ARRAYFORMULA( IF( ISBLANK(B4:B), CONCAT(A4:A,B4:B), CONCAT(A4:A,("_"&B4:B)) ) ) Here is the issue: Sometimes I need the CONCAT formula to put column B first, then Colum A (Example Name2_Name1). Objective: The CONCAT formula needs to be conditional based on a helper column containing the list of valid name options. Logic: If helper column matches CONCAT, CONCAT ColumnA_ColumnB. If helper column does not match CONCAT, ColumnB_ColumnA. If still does not match, leave blank. Expected Results using a helper column [CURRENT DATA SET] [Helper Column] [EXPECTED RESULTS] | A | B | | C | | D | | Name1 | Name2 | | Name1_Name2 | | Name1_Name2 | | Name3 | Name4 | | Name6_Name5 | | Name3_Name4 | | Name5 | Name6 | | Name3_Name4 | | Name6_Name5 | | Name7 | | | Name5 | | | | Name5 | | | Name8 | | Name5 | Is it possible to create an arrayformula to achieve these expected results? Here is my Google Sheet: Click Here
See if this works for you: =ArrayFormula(IFERROR(IFERROR(VLOOKUP(A4:A&IF(LEN(B4:B), "_"&B4:B,), D4:D, 1, 0), VLOOKUP(IF(LEN(B4:B), B4:B&"_",)&A4:A, D4:D, 1, 0))))
How to translate COUNTIFS formula in ARRAYFORMULA to automatically insert the formula in each row
With my countifs formula in column C I want to auto-number (running total) all occurrences of an identical string in column A (e.g. Apple or Orange) but only if on the same row where the string appears column B is of a certain type, e.g. if in column B the type is of "fruit" in column C auto number all occurrences of an identical string in column A. For each new string which is of type "fruit" start the numbering all over again. The outcome should be like this: +---+-----------+-------+---+--+ | | A | B | C | | +---+-----------+-------+---+--+ | 1 | Apple | Fruit | 1 | | | 2 | Apple | Fruit | 2 | | | 3 | Mercedes | Car | 0 | | | 4 | Mercedes | Car | 0 | | | 5 | Orange | Fruit | 1 | | | 6 | Orange | Fruit | 2 | | | 7 | Apple | Fruit | 3 | | +---+-----------+-------+---+--+ The formula in column C: =COUNTIFS($A1:$A$1;A1;$B1:$B$1;"Fruit") =COUNTIFS($A$1:$A2;A2;$B$1:$B2;"Fruit") =COUNTIFS($A$1:$A3;A3;$A$1:$A3;"Fruit") …and so on… I want to translate this formula into an array formula and put this into the header so the formula will automatically expand. No matter what I've tried it won't work. Any help is truly appreciated! Here's a link to a sheet: [https://docs.google.com/spreadsheets/d/1lgbuLbTSnyKkqr33NdVuDEv5eoXFwatX1rgeF9YpIks/edit?usp=sharing][1]
={"ARRAYFORMULA HERE"; ARRAYFORMULA(IF(LEN(B2:B), IF(B2:B="Fruit", MMULT(N(ROW(B2:B)>=TRANSPOSE(ROW(B2:B))), N(B2:B="Fruit"))- HLOOKUP(0, MMULT(N(ROW(B2:B)>TRANSPOSE(ROW(B2:B))), N(B2:B="Fruit")), MATCH(VLOOKUP(ROW(B2:B), IF(N(B2:B<>B1:B), ROW(B2:B), ), 1, 1), VLOOKUP(ROW(B2:B), IF(N(B2:B<>B1:B), ROW(B2:B), ), 1, 1), 0), 0), 0), ))} demo spreadsheet
=ARRAYFORMULA(IF(LEN(B2:B), IF(B2:B="Fruit", MMULT(N(ROW(B2:B)>=TRANSPOSE(ROW(B2:B))), N(B2:B="Fruit")), 0), ))
Compare each cell in two rows, but with an exception
I have a table that keeps track of scores from a test. It compares the row with someone's answers to the row with the correct data: A B C D E +--------------+-----+-----+-----+-------+ 1 | | Q1 | Q2 | Q3 | Score | +--------------+-----+-----+-----+-------+ 2 | Answers | C | B | A | | +--------------+-----+-----+-----+-------+ 3 | George | C | A | B | 1 | 4 | Judith | C | C | A | 2 | 5 | James | A | B | C | 1 | +--------------+-----+-----+-----+-------+ The formula behind the Score column is: =arrayformula(sumproduct(($B$2:$D$2=B3:D3))) The first part of sumproduct is a static reference to the Answers row. The second part is comparing it against the row it's on. However I want to add an exception: if the Answers row contains an asterisk it should consider all answers correct: A B C D E +--------------+-----+-----+-----+-------+ 1 | | Q1 | Q2 | Q3 | Score | +--------------+-----+-----+-----+-------+ 2 | Answers | C | * | A | | +--------------+-----+-----+-----+-------+ 3 | George | C | A | B | 2 | 4 | Judith | C | C | A | 3 | 5 | James | A | B | C | 1 | +--------------+-----+-----+-----+-------+ How would I be able to do this?
Please try: =arrayformula(sumproduct(($B$2:$D$2=B3:D3)+($B$2:$D$2="*")))
=IF(OR($B$2=B3, $B$2="*"), 1, )+ IF(OR($C$2=C3, $C$2="*"), 1, )+ IF(OR($D$2=D3, $D$2="*"), 1, ) this will cover up to 51 questions (columns / range of B:AZ) =IF(LEN($B$2),IF(OR($B$2=B3,$B$2="*"),1,),)+ IF(LEN($C$2),IF(OR($C$2=C3,$C$2="*"),1,),)+ IF(LEN($D$2),IF(OR($D$2=D3,$D$2="*"),1,),)+ IF(LEN($E$2),IF(OR($E$2=E3,$E$2="*"),1,),)+ IF(LEN($F$2),IF(OR($F$2=F3,$F$2="*"),1,),)+ IF(LEN($G$2),IF(OR($G$2=G3,$G$2="*"),1,),)+ IF(LEN($H$2),IF(OR($H$2=H3,$H$2="*"),1,),)+ IF(LEN($I$2),IF(OR($I$2=I3,$I$2="*"),1,),)+ IF(LEN($J$2),IF(OR($J$2=J3,$J$2="*"),1,),)+ IF(LEN($K$2),IF(OR($K$2=K3,$K$2="*"),1,),)+ IF(LEN($L$2),IF(OR($L$2=L3,$L$2="*"),1,),)+ IF(LEN($M$2),IF(OR($M$2=M3,$M$2="*"),1,),)+ IF(LEN($N$2),IF(OR($N$2=N3,$N$2="*"),1,),)+ IF(LEN($O$2),IF(OR($O$2=O3,$O$2="*"),1,),)+ IF(LEN($P$2),IF(OR($P$2=P3,$P$2="*"),1,),)+ IF(LEN($Q$2),IF(OR($Q$2=Q3,$Q$2="*"),1,),)+ IF(LEN($R$2),IF(OR($R$2=R3,$R$2="*"),1,),)+ IF(LEN($S$2),IF(OR($S$2=S3,$S$2="*"),1,),)+ IF(LEN($T$2),IF(OR($T$2=T3,$T$2="*"),1,),)+ IF(LEN($U$2),IF(OR($U$2=U3,$U$2="*"),1,),)+ IF(LEN($V$2),IF(OR($V$2=V3,$V$2="*"),1,),)+ IF(LEN($W$2),IF(OR($W$2=W3,$W$2="*"),1,),)+ IF(LEN($X$2),IF(OR($X$2=X3,$X$2="*"),1,),)+ IF(LEN($Y$2),IF(OR($Y$2=Y3,$Y$2="*"),1,),)+ IF(LEN($Z$2),IF(OR($Z$2=Z3,$Z$2="*"),1,),)+ IF(LEN($AA$2),IF(OR($AA$2=AA3,$AA$2="*"),1,),)+ IF(LEN($AB$2),IF(OR($AB$2=AB3,$AB$2="*"),1,),)+ IF(LEN($AC$2),IF(OR($AC$2=AC3,$AC$2="*"),1,),)+ IF(LEN($AD$2),IF(OR($AD$2=AD3,$AD$2="*"),1,),)+ IF(LEN($AE$2),IF(OR($AE$2=AE3,$AE$2="*"),1,),)+ IF(LEN($AF$2),IF(OR($AF$2=AF3,$AF$2="*"),1,),)+ IF(LEN($AG$2),IF(OR($AG$2=AG3,$AG$2="*"),1,),)+ IF(LEN($AH$2),IF(OR($AH$2=AH3,$AH$2="*"),1,),)+ IF(LEN($AI$2),IF(OR($AI$2=AI3,$AI$2="*"),1,),)+ IF(LEN($AJ$2),IF(OR($AJ$2=AJ3,$AJ$2="*"),1,),)+ IF(LEN($AK$2),IF(OR($AK$2=AK3,$AK$2="*"),1,),)+ IF(LEN($AL$2),IF(OR($AL$2=AL3,$AL$2="*"),1,),)+ IF(LEN($AM$2),IF(OR($AM$2=AM3,$AM$2="*"),1,),)+ IF(LEN($AN$2),IF(OR($AN$2=AN3,$AN$2="*"),1,),)+ IF(LEN($AO$2),IF(OR($AO$2=AO3,$AO$2="*"),1,),)+ IF(LEN($AP$2),IF(OR($AP$2=AP3,$AP$2="*"),1,),)+ IF(LEN($AQ$2),IF(OR($AQ$2=AQ3,$AQ$2="*"),1,),)+ IF(LEN($AR$2),IF(OR($AR$2=AR3,$AR$2="*"),1,),)+ IF(LEN($AS$2),IF(OR($AS$2=AS3,$AS$2="*"),1,),)+ IF(LEN($AT$2),IF(OR($AT$2=AT3,$AT$2="*"),1,),)+ IF(LEN($AU$2),IF(OR($AU$2=AU3,$AU$2="*"),1,),)+ IF(LEN($AV$2),IF(OR($AV$2=AV3,$AV$2="*"),1,),)+ IF(LEN($AW$2),IF(OR($AW$2=AW3,$AW$2="*"),1,),)+ IF(LEN($AX$2),IF(OR($AX$2=AX3,$AX$2="*"),1,),)+ IF(LEN($AY$2),IF(OR($AY$2=AY3,$AY$2="*"),1,),)+ IF(LEN($AZ$2),IF(OR($AZ$2=AZ3,$AZ$2="*"),1,),) and here is "Formula Generator" sheet for that
Search Data for matching row/array
I want to search a set of data to see if it contains a matching set of values eg. +------+------+------+------+ | Col1 | Col2 | Col3 | Col4 | +------+------+------+------+ | A | B | C | D | +------+------+------+------+ would match the last row in +------+------+------+------+ | Col1 | Col2 | Col3 | Col4 | +------+------+------+------+ | B | C | D | A | | A | D | B | C | | A | B | B | D | | D | C | B | A | | A | B | C | D | +------+------+------+------+ A boolean return would be fine. Any pointers would be greatly appreciated. Cheers
Assumptions Columns to check: A:D Values to check are in F1:I1 Result in K1 - boolean Code =NOT(ISERROR( QUERY({ArrayFormula(A1:A&B1:B&C1:C&D1:D)}, "select * where Col1='"&JOIN("",F1:I1)&"'",0) ) ) Picture
Joining two tables, A and B, where the column names of A should be joined with B based on the values of a column in B
The title is a little confusing, so here is an example of the problem I'm facing. Table: FORM_QUESTION Fields: student_id q1_ans q2_ans q3_ans q4_ans q5_ans x--------------x----------x----------x----------x----------x----------x | student_id | q1_ans | q2_ans | q3_ans | q4_ans | q5_ans | x--------------x----------x----------x----------x----------x----------x | 1 | A | D | B | B | E | | 2 | D | C | B | A | D | | 3 | B | C | D | A | B | x--------------x----------x----------x----------x----------x----------x The FORM_QUESTION table stores a student's answers for each question. Here is information on the second table: Table: FORM_VALID_ANS Fields: question_id valid_answer x---------------x----------------x | question_id | valid_answer | x---------------x----------------x | q1_ans | A | | q1_ans | B | | q2_ans | A | | q2_ans | B | | q2_ans | C | | q2_ans | D | | q3_ans | A | | q4_ans | A | | q4_ans | B | | q5_ans | A | x---------------x----------------x The second table, FORM_VALID_ANS, stores the valid, acceptable answers for a particular question. So, according to the above table, here is the acceptable list of values for each question: q1_ans: A, B q2_ans: A, B, C, D q3_ans: A q4_ans: A, B q5_ans: A As you can see, the values for the FORM_VALID_ANS.valid_answer include only the question field names for FORM_QUESTION ("q1_ans", "q2_ans", "q3_ans", "q4_ans", and "q5_ans"). I need to check each students' answer to make sure it is a valid value that they can enter, which is specified in the FORM_VALID_ANS.valid_answer field. The desired output, where XXX represents an invalid value, and all other values would be answered value: x--------------x----------x----------x----------x----------x----------x | student_id | q1_ans | q2_ans | q3_ans | q4_ans | q5_ans | x--------------x----------x----------x----------x----------x----------x | 1 | A | D | XXX | B | XXX | | 2 | XXX | C | XXX | A | XXX | | 3 | B | C | XXX | A | XXX | x--------------x----------x----------x----------x----------x----------x Is it possible to join these two tables together and produce these results (or similar results)?