Two dimensional lookup? - google-sheets

I have a sheet called Shipping that contains the standard shipping costs.
In the columns, I have product.
In the rows, I have destination countries.
So each cell tells me the price to send product to country for the (product, country) pair.
I have another sheet that captures live information on orders.
Column C has product name, and column G has country name.
In column R, I have to provide the shipping cost, based on a lookup of the Shipping sheet.
I am at a loss here, as I am familiar with VLOOKUP and HLOOKUP, but they are uni-dimensional lookups...the number of products/countries is large and dynamic, so I don't want to simply create a separate table to create another lookup for the column/row number to input as index in my original lookup...unless I have to.
Would greatly appreciate any help.

try:
=INDEX(IFNA(VLOOKUP(F2:F&"×"&G2:G, SPLIT(FLATTEN(
IF(B2:D="",,A2:A&"×"&B1:D1&"♦"&B2:D)), "♦"), 2, 0)))

Related

Dropdown lists & conditional formatting in Google Sheets

I am making my business spreadsheet and my business is selling in multiple countries. So, for example, I have a drop-down list (and when Country is chosen I want it to affect the rest of the spreadsheet). In that list, I have all the countries I sell to. What I want to do is for example when I select UK it will update all the prices and costs that are there to GBP AND also hide specific columns that are not necessary for the UK. The same goes for other countries if US is selected I want to see $ currency and hide the column of VAT tax since it doesn't apply to the US.
To summarize, when Country is selected from the dropdown I want it to show different values and hide 1-2 columns. Wondering if this is even possible in sheets. Hopefully, this makes a little bit of sense. Thanks for the help!
Yes It is possible, get only the columns you want from a range.
Dropdown from a list
Go to Data > Data validation Criteria: List from range and Enter a range or formula.
The Formula
Paste this formula next to srearch key range and below the column names you want to search, Take a look at this "freshly made" Example Sheet.
=ArrayFormula(IF($B$2:$B="",,VLOOKUP($B$2:$B,$G$3:$J$16,MATCH(C$1,$G$2:$J$2,0),1)))
Choose the country and all the data will be populated, replacate this formula column and expand the lookup range to get more info put in place.
we are using MATCH to return the matching index from the column above for example Currency C1 from the range G2:J2 which is 2 in this case MATCH function returns the matching value index "column" 2, to be used as an index for vlookup function.

Total Value based on Group cross reference? (Google Sheets)

I'd like to query a couple of tables to come up with a total sum of the value of a set of items, but with the price being dependent on data in another cell range, then grouping it based on category.
For example, say I have a data table containing name, category, and price of some grocery items. Another table I store my current inventory of groceries. I would like to calculate the value of, say, all my fruit.
Here is an editable example:
https://docs.google.com/spreadsheets/d/1y2fLgwrsMr-dWojy3uYZ1Qs2U01AP3RlT_PI2txwZRE/edit?usp=sharing
Not sure the best way to approach this?
Thanks for any guidance!
Solution
Use VLOOKUP for searching the right item of your inventory and then multiply it with the value of the product you made the search with. For more info about VLOOKUP check this documentation.
=VLOOKUP(E3,$A$3:$C$11,3,FALSE)*F3
With these values, create a column next to Quantity indicating the total price for each product (as show in the picture below). Then, create another column with the Type of each item performing a similar VLOOKUP formula:
=VLOOKUP(E3,$A$3:$C$11,2,FALSE)
Finally, use these two columns as input ranges to apply a SUMIF formula for adding up the items of each group:
=SUMIF(H3:H6,"Fruit",G3:G6)
For more info about SUMIF check this documentation.
I hope this has helped you. Let me know if you need anything else or if you did not understood something. :)

In Google Sheets, how to list and sum values in some rows but not others depending on string?

I am trying to join gained level for names in a list.
Some names are the same person who has changed handle and the scores should be summed.
I have created a sheet to track levels for players in rankings over time.
My implementation is not as clever as I would like it to be.
Also, there is a problem with some players changing names.
Example Sheet
Currently, I have
=SORT(UNIQUE({}))
In order to produce just one of each name in a list
In the cell next to that I'm using
=IFERROR(INDEX(MATCH())) + IFERROR(INDEX(MATCH())) + IFERROR(INDEX(MATCH()))
to the sum of levels for each name across several ranges /sessions.
In the example sheet, N7 and N10 is the same person but my SORT, INDEX, as well as QUERY cannot handle this. I would like to (manually type in the names as strings that belong to the same person) and that the latest handle is the one used in query output together with the sum of all gains.
Any direction pointers or suggestions as to how I could improve my current implementation or even solve the problem I'm having would be appreciated.
=ARRAYFORMULA(QUERY({Ranking!CF4:CF200\ SUBSTITUTE(Ranking!CG4:CG200; "N7"; "N10")};
"select Col2,sum(Col1)
where Col2 is not null
group by Col2
label sum(Col1)'',Col2'Total levels gained since 15 April 2018'"; 0))
Might not suit you (could mean an extra column per month) but one way would be to to use a lookup table. That is enter whatever name suits you, lookup the 'standard' for that name and drive further analysis off that.

Summing cells which have certain value next to them AND a certain value is in another column

https://docs.google.com/spreadsheets/d/1xdB1Dl58aGsCOj1Xu1RZRB52Fn4RwbXDHlhuUDHZ1DU/edit?usp=sharing
I maintain spreadsheets for a sawmill. There are different suppliers and wood from them is split into different categories. What I want to do in the summary sheet, is to sum certain values from the Deliveries sheet, so I get an overview of how much of a certain kind of wood we received from a supplier.
Let's do it for "Alice" and "pine". How much pine has Alice brought in this month? I have no problem looking for every "pine" entry and summing it up, as demonstrated in the example, but I want only these pine entries, which are under "Alice" supplier entry. I assume I have to use sumifs(), but what complicates matters is that the "Alice" keyword often isn't straight to the left, because each separate truck is denoted by one supplier entry. Might sound complicated, but the spreadsheet should explain it very well.
I have no idea if there's something way simpler, but unless there is, I want a cell in the "Summary" sheet show me a sum of only those entries in "Deliveries" which have "pine" in the cell to the left AND have "Alice" in the cell two columns to the left or in the first non-empty cell above that in that column.
First obvious suggestion might be to just fill every row with a supplier name, but our actual files and the amount of types of wood are gigantic, it's a no-go. Also other sheets are based on delivery numbers, which are tied to suppliers having a single entry per delivery.
Thanks!
Make sure that every row has a name (in col C) for every type and quantity that is filled in. Then you can try QUERY() for the totals per person:
=query(Deliveries!C1:E, "select C, sum(E) where C <>'' group by C pivot D")
and another QUERY() for the totals
=query(query(Deliveries!D1:E, "select sum(E) pivot D"), "offset 1", 0)

Advance Excel Compare Function

I have an excel sheet which shows the names of 1,900 borrowers. The sheet is not sorted out in alphabetical order (and it does not need to be sorted in alphabetical order). What I am trying to perform is that I want to compare the two column and see if they match. If the two columns do not match I want that result to be shown either in separate column or those names of the countries and responsible person to be highlighted.
For example, the below screen shot shows that there are various countries in the list and there is various responsible person associated with each country. The idea is to identify the countries whose responsible person are not the same. So in this example countries USA & AUSTRALIA should not show up because they have the same responsible person but all other countries and responsible person should be identified. I appreciate and thanks for all the help.
You can solve this by creating a pivot table of your data. Insert pivot table and then add Country name and count of responsible person as grouping (assuming no duplicates) then anything with a count greater than 2 is an issue.

Resources