get google sheet cell value based on value of other cell - arrays

Is it possible in google sheets to write a formula that calculates the cell to fetch based on the value of another.
In this case i would want cell B2 to print the value of e2 so be something like:
='a2'2
Is this possible in google sheets?

try:
=HLOOKUP(A2; E1:F2; 2; 0)

Related

ArrayFormula to automatically calculate one column

I want an array formula to use with Google Forms data to automatically calculate running metrics on my data.
In this case, in column Q, AE and AS I want it to auto-calculate whenever new responses come in.
I'm trying to use this formula below but isn't working for all column, just for the first line.
={arrayformula(if(len(AF3:AF);SUM(vlookup(AF3:AR3;$A$1100:$B$1101;2;0));))}
I want a sum of all words that contain "Verdadeiro" in a row.
What I'm doing wrong?
My Google Sheet:
https://docs.google.com/spreadsheets/d/1AVQ772IIXI-xZza0fecTTCe4S-Ku9rL1houTMnQZpbo/edit?usp=sharing
try in row 1:
={"Total AG";""; ARRAYFORMULA(IF(A3:A="";;
MMULT(N(REGEXMATCH(A3:AR&""; "Verdadeiro")); SEQUENCE(COLUMNS(A3:AR))^0)))}

Google Sheets - Formula to Concatenate Text in Range of Cells based on Numeric Value in Corresponding Range of Cells

I have this setup in Google Sheets:
Row 1 is a list of ingredients. Rows 2-6 are specific plans that contain combinations of ingredients A-F - if there is a 1 in the column, it contains the ingredient in the column.
In column H, I want to concatenate the letters in row 1 if there is a 1 underneath it.
So the formula I'm looking for in Col H should spit out the following:
Cell H2 --> A + B
Cell H3 --> A + C
Cell H4 --> A + B + D
Cell H5 --> A + C + D
Cell H6 --> A
I've tried the TEXTJOIN formula you see in the formula bar but it's not working. Can anyone help with this?
Thanks!
Nevermind, I just figured it out. I had to change my formula above to:
=textjoin(" + ", TRUE, arrayformula(IF($B7:$G7=1, $B$1:$G$1,"")))
Anthony,
If I got it correctly what you want to combine, another option to do that is to use CONCATENATE + IF.
I needed to combine 5 columns but make a note while a cell contains particular data (e.g., when X is in the cell, not to combine columns but write a comment). And the combination of CONCATENATE + IF worked.
I found this solution here.
Hope it'll be somehow helpful :)

How to pass addresses to Vlookup based on cell values (Google Sheets)

This has me stumped, so I'm hoping somebody who knows the proper functions can help me out.
I am trying to do a VLOOKUP, but I want to pass the Range in based on values in columns.
The Range is on a different sheet than where the formula is, and I want the range's start column to be determined by looking for the value that is at the top of the column the forumla exists in.
For example, in the attached image, the 'Dashboard' sheet has Column A as Sheet, and the top Row has Widgets and Sprockets in the top row.
I want the Formula to be a Lookup for the search key 'Total, and return the value in the cell next to it. I want the Range to start on the sheet specified in Column A, and the Column to be the one with the value that matches the one at the top of the column where the formula is.
So my formula will look like
=VLOOKUP("Total",<INSERT RANGE HERE>,2)
Help would be appreciated.
Link to the Google Sheet:
https://docs.google.com/spreadsheets/d/1H5At3gHeTQUm6PWqeA7MT5xcm5RJ38NK6LyhSWUeaZY/edit?usp=sharing
Thanks Stack Overflow Community
I believe this is what you're looking for.
On the Dashboard sheet enter these formulas:
C3:
=vlookup("Total", indirect($A3&"!C1:D"),2)
D3:
=vlookup("Total", indirect($A3&"!C1:F"),4)
You can then select C3:D3 and drag down to autofill. I tried using an arrayformula and it didn't work, but I might have been doing it wrong
Also make sure to change "Position1" and "Position2" to match the sheet names exactly.
Edit: I just saw your screenshot. These formulas can also be put into C2 and D2, I just put them next to the sheet names to keep track of what I had to do.
Edit in response to comment:
This was the closest I could get to what you're looking for.
C3:
=vlookup("Total", indirect($A3&"!C1:"&ADDRESS(ROW(INDIRECT($A3&"!$C50")),COLUMN()+1)),2)
D3:
=vlookup("Total", indirect($A3&"!E1:"&ADDRESS(ROW(INDIRECT($A3&"!$E50")),COLUMN()+1)),2)
Again, these columns can be dragged and autofilled down with no issues.
I have the following formula that can be pasted onto the dashboard C3 cell, and then copied across: =address(1,match(C$1,indirect($A3&"!1:1"),0),,,$A3) This will give me the address I want from the Sheet I am trying to reference, i.e. Position01!$C$1 Also, If I use the following formula, I get the value I want as a result: =offset(Position01!$C$1,7,1,1,1) However, If I try to combine the two, I get the error 'Argument must be a range'. =offset(address(1,match(C$1,indirect($A3&"!1:1"),0),,,$A3),7,1,1,1)
You need to add INDIRECT in front of the first formula when placing it inside of the OFFSET one so that it reads the result address as a range instead of a string:
=offset(INDIRECT(address(1,match(C$1,indirect($A3&"!1:1"),0),,,$A3)),7,1,1,1)
use:
=INDEX({VLOOKUP("Total", Position01!C:F, {2, 4}, 0);
VLOOKUP("Total", Position02!C:F, {2, 4}, 0)})
update:
if your project consists of 24 rows but unknown number of columns then you can use range:
Position01!C1:24 (instead of Position01!C:F)
then to return every column you can do:
COLUMN(Position01!C1:1)-1 (instead of {2, 4})
or if you want to return every 2nd column:
FILTER(COLUMN(Position01!C1:1)-2, MOD(COLUMN(Position01!C1:1), 2)=0)
(instead of {2, 4})

How to pull the most recent change on an item in Excel using arrays

I'm trying to pull the most recent change to an item from a list of values and dates.
I've pasted a URL below for the image of the spreadsheet I'm currently working on.
This is currently in the top left of the spreadsheet, starting in cell A1.
I am trying to display in column C the "New Value" where columns A and E match, and where it is the most recent date in column F before the date listed in column B.
For C2, it would be 1.99
For C3, it would be 2.99
For C4, it would be 3.99
I'm trying to use INDEX, MATCH, and MAX to create an array and return the row number,
This is what my formula currently looks like:
=INDEX($H$2:$H$4,MAX(MATCH(1,(($E$2:$E$4=A2)*($F$2:$F$4<B2)),0)),4)
However I can't quite get it to display the correct values.
When I evaluate the formula, it looks like the array is evaluating correctly,
However I am having a difficult time because where it says {1,1,0} for C3, it will only result in the first match.
How can I change this array formula to only look at the last match row?
Use MAXIFS inside a SUMIFS:
=SUMIFS(H:H,E:E,A2,F:F,MAXIFS(F:F,F:F,"<="&B2,E:E,A2))
IF one does not have MAXIFS, we can replace with AGGREGATE:
=SUMIFS(H:H,E:E,A2,F:F,AGGREGATE(14,7,$F$2:$F$4/(($F$2:$F$4<=B2)*(E2:E44=A2)),1))
or if one has the Dynamic Array Formula:
=INDEX(SORT(FILTER(E:H,(E:E=A2)*(F:F<=B2)),2,-1),1,4)

Array result from INDIRECT

So, I have a Google Sheet connected to a Google Form that I use for debugging a series of games. Each game has a Unit number and an Activity number.
I added to the sheet a column that, basing on the Unit and on the Activity, retrieves the name of the developer, contained in another sheet.
=INDIRECT("Developers!"&CHAR(C1+64+1)&(B1+1))
(I have to add 1 to each value because the other table has headers)
The formula does work on a single cell, but it's not applied to the new lines inserted by the Google Form.
I've seen that ARRAYFORMULA() returns an array that automatically populates the cells below.
Is there a command I can use to apply a formula to an array of values and have an array of results returned?
if you want to get just a range do:
=INDIRECT("Developers!"&ADDRESS(B1+1, C1+1, 4)&":"&ADDRESS(ROWS(A:A), C1+1, 4))
or populated range:
=INDIRECT("Developers!"&ADDRESS(B1+1, C1+1, 4)&":"&ADDRESS(COUNTA(B:B), C1+1, 4))

Resources