Dynamic dropdowns, INDIRECT, multiple rows - arrays

So I have this "Google Sheets App" in one row. It has 2 interactive dropdowns (Dropdown B options appear based on Dropdown A), and some fields which change based on the option. I finally got all that to work using ARRAYFORMULA(INDIRECT), VLOOKUP, and so on. And it all works well, for the first row.
However, I need many rows of that, so I select the entire first row, and extend it all the way down. However, now Dropdown B options are based on the Dropdown A option FROM THE FIRST ROW, not the row where I'm picking stuff currently. And I understand that my ARRAYFORMULA(INDIRECT) is linked that way, and I would have to delete the first row if I was going to pick something else from another row. What I want to know is if it's possible to go around that, basically new row = new options, just keep the first row as simple values, don't affect anything else? Or at least somehow export the data from the row with a single click, so I can delete it and start all over again for new data?
This would ideally be done in a click since my boss wants me to make a completely functioning enterprise software in Google Sheets!
Google Sheet:
https://drive.google.com/file/d/1HRZsqKyIxD35dqCmCc75ldbtZeGvimKD/view?usp=sharing

try:
=ARRAYFORMULA(IFNA(
IFERROR(VLOOKUP(D2:D, data!A1:B20, 2, 0),
IFERROR(VLOOKUP(D2:D, data!A21:B42, 2, 0),
IFERROR(VLOOKUP(D2:D, data!A43:B54, 2, 0),
IFERROR(VLOOKUP(D2:D, data!A55:B61, 2, 0),
IFERROR(VLOOKUP(D2:D, data!A62:B94, 2, 0),
IFERROR(VLOOKUP(D2:D, data!A95:B101, 2, 0),
VLOOKUP(D2:D, data!A102:B139, 2, 0)))))))))
H2 would be:
=ARRAYFORMULA(IF(F2:F="",,VALUE(TEXT(G2:G-F2:F, "h:mm:ss"))*24*60*60))
and I2 would be:
=ARRAYFORMULA(IF(E2:E="",,IF(E2:E>40, "Paket unijeti rucno", E2:E*H2)))

Related

How do I conditionally sum a cell based on the value of another cell?

I have a terrible formula that looks like this:
=if(B17="Yes",B$7)+if(C17="Yes",C$7)+if(D17="Yes",D$7)+if(E17="Yes",E$7)+if(F17="Yes",F$7)
I'd also like to be able to expand it if I go longer than column F.
Basically, other people can change their own row, in this example row 17, but there are many many rows just like it.
https://docs.google.com/spreadsheets/d/1YKCaGKVmiqfJQz9RcLiLOFXVpUqScNXcYOkPVSOVKz4/edit?usp=sharing
try:
=INDEX(IFERROR(1/(1/SUM(IF(B17:W17="yes", B$7:W$7, )))))
update
or delete everything in Y17:Y and use this on Y17:
=INDEX(IFERROR(1/(1/MMULT(IF(B17:W="yes", B7:W7, 0), SEQUENCE(COLUMNS(B:W), 1, 1, )))))

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 do you use ArrayFormula with arrays (after aggregation)?

In my example:
https://docs.google.com/spreadsheets/d/1QQNTw_r9-q-FqVNwUoYklup73niZCFyO0VDUYImP5fo/edit?usp=sharing
I'm using Google Forms as an eBay clone to sell rare items. Each bid is outputted from the form to the "Data" worksheet and then I have ArrayFormulas set up inside the "Processed" worksheet. The idea is that I want to process the bids so that we filter everything except the items with the highest bids. All data should be automatically updated, hence why I want to use ArrayFormulas.
My strategy is that in colum A, I first filter all unique items (=unique(filter(Data!A2:A,Data!A2:A<>""))) and end up with:
Jurassic Park 6-Pog Hologram Set
Princess the Bear TY Beanie Baby
Holographic 1st Ed Charizard
However, then in column B, we have to find the highest bid that corresponds to that unique item, e.g.:
=IF(ISBLANK(A2),,ArrayFormula(MAX(IF(Data!A2:A=A2,Data!B2:B))))
However, I don't want to have A2 be a single cell (A2) but an array (A2:A) so that it doesn't have to be manually copied down the rows. Similarly, I also want columns D and E to be automatic as well. Is there any way to achieve this?
Not sure if it would be considered easier than the previously posted answer, but in case this thread is found in the future, I think that this is a slightly simpler way to solve these kinds of problems:
Try this on a fresh tab in cell A1:
=FILTER(Data!A:D,COUNTIFS(Data!A:A,Data!A:A,Data!B:B,">"&Data!B:B)=0)
I did some research and found an answer very similar to what you were looking for. After rearranging the formula slightly to match your sheet, I was able to get this to work:
=ArrayFormula(vlookup(query({row(Data!A2:A),sort(Data!A2:C)},"select max(Col1) where Col2 <> '' group by Col2 label max(Col1)''",0),{row(Data!A2:A),sort(Data!A2:D)},{2,3,4,5},0))
This formula automatically populates product name, highest bid, username, and timestamp. I ran some tests, adding my own random names and values into the data sheet, and the formula worked great.
Reference: https://webapps.stackexchange.com/a/75637
use:
={A1:D1; SORTN(SORT(A2:D, 1, , 2, ), 9^9, 2, 1, )}
translated:
{A1:D1} - headers
SORT(A2:D, 1, , 2, ) - sort 1st column then 2nd column descending
9^9 - output all possible rows
2 - use 2nd mode of sortn which will group selected column
1 - selected column to be marged based on unique values

OBIEE - Change pivot table row values based on prompt

I currently have a set of 12 pivot tables that I display based on a prompt. So the user simply clicks on a 'View By:' dropdown and chooses which table to view. This was accomplished through simple 'dummy tables' and a presentation variable.
My question: Can I set up a similar prompt to change the row values in my pivot tables?
For example, my row values are currently annual (12, 24, 36, ...). I would like to give the user the option to view the data on a quarterly (3, 6, 9, ...) and monthly (1, 2, 3, ...) basis.
Can I add a second 'View By:' dropdown so the user can select both the table, and row values the table is displayed on?
I'm assuming you have a period dimension, with columns for year, quarter and month. If not, you may be able to use a variant of this.
If so, you can use the index col function. To set this up:
You would have a variable prompt, setting a presentation variable with the options [annual, quarterly, monthly]
In your answer, you would have one period column, changing the column formula to use the indexcol function. It would look something like:
INDEXCOL(CASE '#{myPresentationVariable}' WHEN 'annual' THEN 0 WHEN 'quarterly' THEN 1 WHEN 'monthly' THEN 2 END, period.year, period.quarter, period.month)
I was making this much more difficult than it needed to be. The solution is to create Groups for the different buckets of values I was referencing ((1,2,3,...), (3,6,9,...), (12,24,36,...)). Then simply set the corresponding column filter to Is Prompted and add the newly created Groups as Choices to your prompt's choice list.

Custom filtering

Please suggest the best way for me. I want to change the default filter's behavior. I want my grid filter to work with all data from DB, not only with displayed data in the grid.
For example:
I have 5 rows in the db-table (1, 2, 3, 4, 5)
In the grid->ItemsSource i bound only 2 records (1 and 2)
when i click to the filter i want to see all records from DB (1, 2, 3, 4, 5) and if i check 4 and 5 for example, grid gets from DB data and display selected in the filter rows (4, 5).
What is the best way for me to solve my tasks?
Thanks
DomainDataSource will perform server-side filtering. Is that what you are looking for?

Resources