Excel Index + if + indirect - arrays

I am helping a friend with a work task he's been given and can't figure out the last part. We are given a matrix with a list of workers / users in the following layout:
Location | First Name | Last Name | Property 1 | Property 2 | Property 3 | .. | Property N
Frankfurt | Adam | Schmidt | X | | X | .. | X,
i.e. the properties are in boolean form (X to indicate 'Yes', or empty to indicate 'No').
The task is to search all users based on Location + 1 property that we are able to select from the N properties, i.e. we have a drop-down menu somewhere with all properties 1,2,..,N where we can select exactly 1 of the properties.
The output should be the format: Location | First Name | Last Name.
So, my idea was to replace the standard IF(("array for criteria 1"= "criteria 1") * ("array for criteria 2" = "yes"), ...) with the ADDRESS of the property we select, which we then transformed from text value into cell reference using the INDIRECT function.
To give an example, if we select property 1 (located in column D) in the drop-down menu, the ADDRESS function will return $D$1 as the starting field, and $D$100 as the ending field. These fields are then used inside an INDIRECT function inside the main (long) search function.
I've seen from other posts on the internet that it is possible to use SUM(INDIRECT(cell with starting cell defined&":"&cell with ending cell defined)), so I tried something similar in my function, but it doesn't seem to work.
Here is a picture of the formula & layout of the excel file.

You should organize your sheet into 3 sections:
Data set
Criteria
Result Set
Follow the steps to create the button action for Search.
Navigate to 'Developer' tab.
Click on Insert > Button.
Draw a button. The 'Assign Macro' dialog box will be displayed.
Click on Record.
Enter the macro name as 'SearchRecords' and click on OK.
Click on any empty cell. Navigate to 'Data' tab.
In the 'Sort & Filter' section click on 'Advanced'.
Select 'Copy to another location' radio button and enter the range based on data set and criteria locations.
Click on OK.
Navigate to 'Developer' tab and click on 'Stop Recording'.
Rename the button to 'Search'.
Now you can update the search criteria and click on the search button to update the results in the adjacent location.

A much easier way would be to organize your input data as follows:
This data set is Pivot friendly. You can then create a Pivot Table of the data set. Move the Location and Property fields to the Report Filter section, the Full Name to the Row Labels section and the Location to the Values section.
Please note Full Name is just a concatenated value of 'First Name' & 'Last Name'.

Related

How to add a filter in a VEEML story

I just create a story in VEEML based on a Dataview.
I would like to add a filter that users can use by the "Filters" buttons on top of the new story.
To add a filter based on 1 column of your dataview :
1/ At the bottom of the left menu, click on the database icon to open the datafields options
2/ search the field you want as a filter
3/ Expand that field
4/ In the tab "Filters", check the checkbox
5/ Select the right type of the filter in the the list :
Buttons (multi-values) : It appears as buttons. The user will be able to select 2 or more values.
Buttons (single-value) : It appears as buttons. The user will be able to select only 1 value.
FromTo : use only that type on a field containing an ISO day (format = YYYYMMDD). It appears as 2 calendar fields.
List : the field will be display as a listbox. The user will be able to select 2 values or more and can make a search.
Autocomplete : it appears as a text box. The user can begin to write the value in that textbox and choose the right value he wants to select.
PS : if you have less than 10 distinct values in your field , the buttons could be the best option. Between 10 and 500 distinct values, choose a list. More than 500 distinct values, consider to use an autocomplete field.
6/ Once created, you can specify a specific index in the Filters window for that filter.
For instance, if you create a filter on the field "Year" with the index 10, specify 20 for the field "month" and 30 for the field "Week".
7/ Once done, you can colapse the field and Close the pop-up window.

Google Sheets - query for one tab works great but I get Value error when adding a 2nd tab to the query

In a Google Sheet I am wanting to compile data from a specific date across multiple tabs chosen by using Query and Select. My formula works perfectly for the query of 1 tab, but when I add a second tab (there are about 17 in total I want to add), I get the following VALUE error:
"Function QUERY parameter 3 expects number values. But 'select * where B=date '2021-10-12' order by C ASC' is a text and cannot be coerced to a number."
Here is a link to an editable copy of the document. The formula is in the first tab (Schedule), cell A3:
Editable copy of the sheet here

Fill a text field with a preset value based on the selected value of a list in XLS Forms

I am building an xlsx form for ODK. I have a dropdown list and a text-input field. I would like when I select a value from the ListA, a specific code to be filled in the text-input field.
For example if I choose "valueA" from the dropdown list the value "codeA" to appear in the text-input.
Currently I have an excel sheet with all the matches between the values in ListA and the corresponding codes (around 300). All the values in ListA are unique.
I was making some tests trying to use the "Calculation" field of Xls but no success till now.
Has anyone done something like that with Xls? Is it possible?
You could include a calculate field between the dropdown list and the text-input where you pull values from a csv file with the correspondence between valueA and codeA using the value selected in ValueA as a key. You can find an explanation of how the pulldata(...) calculation works here.
Here goes a brief example. In the survey tab:
|type |name |label |calculation|
|select_one keys|value_a|Value A | |
|calculate |code_a | |pulldata('data', 'value_column', 'key_column', ${value_a}|
|note |note |Code A value: ${code_a}| |
In the choices tab:
|list_name|name |label |
|keys |valueA_1|valueA_1|
|keys |valueA_2|valueA_2|
(.......)
And the file data.csv should look like this:
|value_column|key_column|
|valueA_1 |codeA_1 |
|valueA_2 |codeA_2 |
(.......)
Finally, I would advice to consider applying a cascade selection layout in value_a, because selecting one out of 300 values can be challenging. Another option could be sorting these choices alphabetically or in a different order, such that when someone fills-in your form she will know how to easily locate the appropriate choice.
Hope this helps!

Pie Chart with connected google sheet

I have a 2 column table on one google sheet.
|user| count |
| a | 1 |
| b | 3 |
I connect the google sheet to a new google data studio project, and it creates 2 dimensions.
When I add a piechart, i cannot get the labels from column "user" to be shown, and it just shows the counts.
The google sheet contains multiple tabs that i will use like tables. Im using the created dimensions to populate the piechart.
Any help with this? Im very new to google datastudio.
For the pie chart select user as dimension and count as metric in the DATA panel:
You can then, in the STYLE tab, change the labels to label instead of value:
Or, if you want to keep the count, just leave value as labels and add a legend:

Concatenate values in one row with comma as delimiter in TABLEAU worksheet

Currently my sheet looks like:
Type | Product
A | p1
B | p2
A | p2
C | p3
I want my sheet to look like:
Type | Product
A |p1,p2
B |p2
C |p3
I want to show all products of Type 'A' in one row. To avoid duplicates 'A' entries.
You will need to create a couple table calculations to do this:
create 1 named Products:
IF INDEX() = 1
THEN ATTR([Product])
ELSE
PREVIOUS_VALUE(ATTR([Product]))+ ", "+ ATTR([Product])END
This needs to be set to compute using pane down
Then create another called Rank
RANK([Products])
Put Type, Rank (you will need to change this to discreet to put between type and product), and your original Product field into your Rows.
Right click on your "Rank" and "Product" fields in the row and deselect "Show Header"
put "Rank" into your filters and set it to only be the value of "1"
You will then need to right click on Rank and set it to Calculate using "Pane(across then down)"
Put your new "Products" measure into your text mark.
With this you should get a sheet that looks like this:

Resources