References changing in Google Sheets with new forms submissions - if-statement

I have a Google sheet that feeds from a Google form and then I use the sheet to make views to show data and graphics on Google sites. I noticed that suddenly the graphics said 'No Data', and when I checked, it seemed that for some reason the ranges that feed such tables had changed their referenced cells to the newest row from the submitted forms instead of retaining the range even if it was fixed.
I have no idea why or how this happened, but it happened in different places and different formulas along with the sheets, not on all but quite on many. Previously it was working fine.
This happened to formulas for 1 cell and column arrays alike. The change was merely that instead of using let's say L2:L, it changed the 2 for 54 so it ended like L54:L, even if it was fixed with $.
For example: Originally $AA$2:$AA became $AA$54:$AA
NOTE: This has affected random sections and other columns that have the same formula may not be affected, regardless as to if they refer the same columns or adjacent ones.
The following are examples of this change, where 54 should have been 2.
1: An array that works on an entire column.
={"Person";ArrayFormula(IF(LEN(A54:A), 'Responses'!AL54:AL&"" &
'Responses'!AK54:AK&
" " & 'Responses'!AJ54:AJ&
" " & 'Responses'!AI54:AI
,""))}
2: A mere count of responses that has a fixed range
=COUNTIF('Responses'!$AY$54:$AY, "si")
And 3: A count for different values
=countifs('Responses'!$AA$54:$AA,"Sí",
'Responses'!$AD$54:$AD, "<>Rod",
'Responses'!$AD$54:$AD, "<>Ato",
'Responses'!$AD$54:$AD, "<>Ref",
'Responses'!$AD$54:$AD, "<>Cua"
)
There are no error messages.
I'm just trying to comprehend how this happened to avoid it happening again on further forms submissions (done by another person) and to correct this (hopefully not manually).

to truly lock down the range you need to use INDIRECT:
={"Person";
ARRAYFORMULA(IF(LEN(INDIRECT("A2:A")), INDIRECT("Responses!AL2:AL")&"" &
INDIRECT("Responses!AK2:AK")&
" " & INDIRECT("Responses!AJ2:AJ")&
" " & INDIRECT("Responses!AI2:AI"), ))}
=COUNTIF(INDIRECT("Responses!AY2:AY"), "si")
=COUNTIFS(INDIRECT("Responses!AA2:AA"), "Sí",
INDIRECT("Responses!AD2:AD"), "<>Rod",
INDIRECT("Responses!AD2:AD"), "<>Ato",
INDIRECT("Responses!AD2:AD"), "<>Ref",
INDIRECT("Responses!AD2:AD"), "<>Cua")

Related

How to automatically feed a cell value from a range of values, based on its matching condition with other cell value

I'm making a time-spending tracker based on the work I do every hour of the day.
Now, suppose I have 28 types of work listed in my tracker (which I also have to increase from time to time), and I have about 8 significance values that I have decided to relate to these 28 types of work, predefined.
I want that, as soon as I enter a type of work in cell 1 - I want the adjacent cell 2 to get automatically populated with a significance value (from a range of 8 values) that is pre-definitely set by me.
Every time I input a new or old occurrence of a type of work, the adjacent cell should automatically get matched with its relevant significance value & automatically get populated in real-time.
I know how to do it using IF, IFS, and IF_OR conditions, but I feel that based on the ever-expanding types of work & significance values, the above formulas will be very big, complicated, and repetitive in the future. I feel there's a more efficient way to achieve it. Also, I don't want it to be selected from a drop-down list.
Guys, please help me out with the most efficient way to handle this. TUIA :)
Also, I've added a snapshot and a sample sheet describing the problem.
Sample sheet
XLOOKUP() may work. Try-
=XLOOKUP(D2,A2:A,B2:B)
Or FILTER() function like-
=FILTER(B2:B,A2:A=D2)
You can use this formula for a whole column:
=INDEX(IFERROR(VLOOKUP(C14:C,A2:B9,2,0)))
Adapt the ranges to your actual tables in order to include in the second argument all the potential values and their significances
This is the formula, that worked for me (for anybody's reference):
I created another reference sheet, stating the types of work & their significance. From that sheet, I'm using either vlookup, filter, xlookup.Using gforms for inputting my data.
=ARRAYFORMULA(IFS(ROW(D:D)=1,"Significance",A:A="","",TRUE,VLOOKUP(D:D,Reference!$A:$B,2,0)))

Automating cell references

I have a standard sheet formatted like this, with columns going linearly
First Name Last Name Contact Type Address Address 2 City State
My goal is to take the data in this sheet and format it differently in another sheet, like this, vertically
First Name Last Name
Contact Type
Address
Address 2
City State Zip
For the users, they can then use this to print out mailing labels (plus for some of my users, reading info in block form is just easier)
So I can do something like this in the new sheet
={NameDirectory!B4&" "&NameDirectory!C4}
={NameDirectory!D4}
={NameDirectory!E4&" "&NameDirectory!F4}
etc, so each line grabs the right data, so the address appears in a block
Of course, the next block will be similar
={NameDirectory!B5&" "&NameDirectory!C5}
={NameDirectory!D5}
={NameDirectory!E5&" "&NameDirectory!F5}
The only thing that changes is the number as I have merely shifted down a row.
I keep thinking there must be an easier way to do this, other than copying the formula, pasting it in and manually changing B5 to E5. Likewise, I can drag the formula down multiple rows, but it changes the number not the letter as I want.
Is there anyway I can achieve what I want without a lot of copying and pasting?
Here is an example (not sharing the original as it as real contact information, so this has two entries, but the original has around 50+)
https://docs.google.com/spreadsheets/d/1Ob4JXRT0CqqOb94-3Mqt1wu2LSsm3oeodc0eTPtT_3U/edit#gid=0
try:
=ARRAYFORMULA(FLATTEN(QUERY(SPLIT(FLATTEN(QUERY(TRANSPOSE(SUBSTITUTE(
{Sheet1!A2:A&" "&Sheet1!B2:B, Sheet1!C2:E, Sheet1!F2:F&", "&Sheet1!G2:G&" "&Sheet1!H2:H, Sheet1!I2:K,
IF(Sheet1!A2:A="",," ")}, " ", CHAR(13))),,9^9)), " "), "where not Col2 contains ','", 0)))

How to apply conditional formatting (if cell is in another range) to a range of cells

So I have searched through several different questions related to this. None of them seem to be asking exactly what I'm looking for and none of the solutions I've found have worked for me thus far.
I have several columns of data (Player names) where each column's values are generated from a formula in the 2nd row of that column. The 1st row is a header (Game name). This whole range is the collection of which players are willing to play which games. These are columns D-J(ish, the list is dynamically generated with another formula, based on form responses)
I have another range of data where the 1st column is the Player and the 2nd is the player's PREFERRED game. This data is also generated with a formula based on form responses. These are columns A-B.
Here's what I'm trying to do
Using conditional formatting in columns D-J, I want to highlight the player's name if this game (in row 1 of this column) is their preferred game (range A2:B).
I've tried several different variations of VLOOKUPS, MATCHES, and FILTERS in the conditional formatting, but so far nothing has worked. The problem I run into every time is that I can't figure out how to reference the cell that the formatting is applying to, but still have it reference each individual cell over the whole range.
I know I could do this if I applied an individual conditional formatting to each individual cell. However that is a very time consuming and inelegant solution to this issue considering I'm expecting my data range to be much larger in the future. I need a conditional formatting formula that will work across the whole range or , at the very least, for an entire column.
This is a mock of what I'm trying to accomplish:
This is a link to a mock of my sheet so that you can clearly see the data layout and specific formulas I'm using:
https://docs.google.com/spreadsheets/d/1wy1T6dWJwNC_EfdCAbkuxtkJH7y4Cg3x4IyEk6R567M/edit?usp=sharing
use:
=REGEXMATCH(D3, TEXTJOIN("|", 1, FILTER($A$3:$A, $B$3:$B=D$2)))

How can I resolve INDEX MATCH errors caused by discrepancies in the spelling of names across multiple data sources?

I've set up a Google Sheets workbook that synthesizes data from a few different sources via manual input, IMPORTHTML and IMPORTRANGE. Once the data is populated, I'm using INDEX MATCH to filter and compare the information and to RANK each data set.
Since I have multiple data inputs, I'm running into a persistent issue of names not being written exactly the same between sources, even though they're the same person. First names are the primary culprit (i.e. Mary Lou vs Marylou vs Mary-Lou vs Mary Louise) but some last names with special symbols (umlauts, accents, tildes) are also causing errors. When Sheets can't recognize a match, the INDEX MATCH and RANK functions both break down.
I'm wondering how to better unify the data automatically so my Sheet understands that each occurrence is actually the same person (or "value").
Since you can't edit the results of an IMPORTHTML directly, I've set up "helper columns" and used functions like TRIM and SPLIT to try and fix instances as I go, but it seems like there must be a simpler path.
It feels like IFS could work but I can't figure how to integrate it. Also thinking this may require a script, which I'm just beginning to study.
Here's a simplified example of what I'm trying to achieve and the corresponding errors: Sample Spreadsheet
The first tab is attempting to pull and RANK data from tabs 2 and 3. Sample formulas from the Summary tab, row 3 (Amelia Rose):
Cell B3: =INDEX('Q1 Sales'!B:B, MATCH(A3,'Q1 Sales'!A:A,0))
Cell C3: =RANK(B3,$B$2:B,1)
Cell D3: =INDEX('Q2 Sales'!B:B, MATCH(A3,'Q2 Sales'!A:A,0))
Cell E3: =RANK(D3,$D$2:D,1)
I'd be grateful for any insight on how to best index 'Q2Sales'!B3 as the correct value for 'Summary'!D3. Thanks in advance - the thoughtful answers on Stack Overflow have gotten me this far!
to counter every possible scenario do it like this:
=ARRAYFORMULA(IFERROR(VLOOKUP(LOWER(REGEXREPLACE(A2:A, "-|\s", )),
{REGEXEXTRACT(LOWER(REGEXREPLACE('Q2 Sales'!A2:A, "-|\s", )),
TEXTJOIN("|", 1, LOWER(REGEXREPLACE(A2:A, "-|\s", )))), 'Q2 Sales'!B2:B}, 2, 0)))

Google Sheets, multi-tab, multi-criteria if statements

I'm building a staff allocation sheet for our production teams so that management can see (graphically) the peaks and troughs for each department. I've anonymised the data and shared it here: https://docs.google.com/spreadsheets/d/140w_v_ApksXH2q7h_dK5Iglm0VOTF1Zk9fq9jPxF5BM/edit?usp=sharing
What I am attempting to achieve is to have the week commencing dates across the top, the employees down the left (Based on a unique list of employees form the department tabs) and the individual cells populated with the relevant show number (I've manually entered the first two employees).
I had done this successfully by having hidden proxy columns for each show that pull a start and end date from the department sheet via and indirect lookup. Where this falls down is if an employee works on a production at two separate times, e.g. all of May and all of August but not between those months.
I initially attempted a series of nested ifs:
=if(and(indirect($A3&"!$B:$B")=$B:$B,
indirect($A3&"!$E:$E")<=AK$2,
indirect($A3&"!$F:$F")>AK$2,
indirect($A3&"!$C:$C")="SHOW #1"
),1,
if(and(indirect($A3&"!$B:$B")=$B:$B,
indirect($A3&"!$E:$E")<=AK$2,
indirect($A3&"!$F:$F")>AK$2,
indirect($A3&"!$C:$C")="SHOW #2"
),2,
if(and(indirect($A3&"!$B:$B")=$B:$B,
indirect($A3&"!$E:$E")<=AK$2,
indirect($A3&"!$F:$F")>AK$2,
indirect($A3&"!$C:$C")="SHOW #3"
),3,
. . .
if(and(indirect($A3&"!$B:$B")=$B:$B,
indirect($A3&"!$E:$E")<=AK$2,
indirect($A3&"!$F:$F")>AK$2,
indirect($A3&"!$C:$C")="SHOW #17"
),17,
0)))))))))))))))))
Hoping that this would calculate in each cell and return the correct result, however this did not work, that's when I discovered if() doesn't work with ranges in this context! I've effectively hit a wall on this.
I feel like I'm missing something obvious in this and would appreciate any help!!!