Google Sheets Index Match Not Found - google-sheets

Working on a spreadsheet to list inventory items for sale in bulk. Wanting it to automatically generate a "Condition Note" for each item based on it's SKU and Category.
Have a sheet named "Description Table" that has Condition Notes arranged by Category (row) and Condition (column.) The last 2 digits of the item's SKU determine its condition.
This is the formula I have so far, but it's giving an error that it's not finding the row in the MATCH evaluation, specifically "Did not find value '43' in MATCH evaluation." 43 is located in A6 of the Description Table sheet. Any ideas?
=INDEX('Description Table'!A1:J23,MATCH(RIGHT(C2,2),'Description Table'!A:A,0),MATCH(B2,'Description Table'!1:1,0))
Here's the spreadsheet: https://docs.google.com/spreadsheets/d/1SBtJicsKlxykBfKwwLyeHV__ope-D1lciA8X2FD3CKo/edit?usp=sharing

You can't match the string "43" with the number 43. You need to convert the string to a number:
=INDEX('Description Table'!A1:J23,MATCH(value(RIGHT(C2,2)),'Description Table'!A:A,0),MATCH(B2,'Description Table'!1:1,0))

use:
=ARRAYFORMULA(IFNA(VLOOKUP(RIGHT(C2:C, 2)*1, 'Description Table'!A3:K,
MATCH(B2:B, 'Description Table'!A1:K1, 0), 0)))

Related

Google sheets question - filter sum equation

I have a list of email addresses in one sheet (first column).
I have a list of transactions in another sheet with emails and sale amounts.
I am looking for a formula that adds up all the transaction $ sales for any transactions made by the people (emails) in the first sheet.
Any help would be much appreciated!
Your sample data is very limited (only one row matching one person, in fact). But the following formula should work for you. Place it in a new sheet, in cell A1:
=ArrayFormula(IFERROR({"Name","Total"; QUERY(FILTER(Transactions!A2:D,NOT(ISERROR(VLOOKUP(Transactions!A2:A,Tags!A:A,1,FALSE)))),"Select Col2, SUM(Col4) GROUP BY Col2 ORDER BY Col2 LABEL SUM(Col4) '' ")},"No Data"))
This one formula will produce the headers (which you can change within the formula itself as desired) and all results.
FILTER filters in only 'Transactions' data (names through amounts) where the emails are found in the 'Tags' sheet.
Then QUERY returns the name and totals for each match in alphabetical order by name.
If there are no matches, "No Data" will show instead.
If I understood your question correctly!
Try this on the sheet, where you only have emails and wanted to get sum of sales amount
=sumifs(range_whichHasTransaction , range_of_Email_inThat_TransactionsTable , Cell_Reference_ofEmail_forWhich_you_want_sum_the_Transaction_Amount)
it will Look something like this:-
sumifs(TransactionSheet!B:B,TransactionSheet!A:A,Emails!A2)
Reference
SUMIFS

Formula to build report of employees that are not working between 2 dates

I am trying to find a way to see which employees are not working between 2 dates.
Should I use vlookup, index & match, filter, query, or something else?
Sheet 1 contains employee details & start/end dates.
Sheet 2 accepts user input to select 2 dates, and it will automatically display a list of available employees who are not working.
Sheet 1 - Database/Log of all employees and days worked.
#
A
B
C
D
1
ID
Name
Start Date
End Date
2
12345
John
01/01/2021
01/08/2021
3
54321
Sarah
01/24/2021
01/29/2021
4
00731
James
02/05/2021
02/15/2021
5
00731
John
02/10/2021
02/30/2021
Sheet 2 (Row 1-2)- Manually enter in two dates.
#
A
B
1
Start Date (Manual input)
End Date (Manual input)
2
01/01/2021
01/30/2021
Sheet 2 (Row 3+)- List of all employees that are not working between the two dates entered in Sheet 2!A2:B2 (Expected Results)
#
A
B
3
ID
Name
4
00731
James
try:
=INDEX(SUBSTITUTE(UNIQUE(QUERY(""&SPLIT(FLATTEN(IF(SEQUENCE(1, MAX(D2:D-C2:C))<=D2:D-C2:C,
"♥"&A2:A&"♦"&B2:B&"♦"&C2:C+SEQUENCE(1, MAX(D2:D-C2:C), 0), )), "♦"),
"select Col1,Col2 where not Col3 matches '"&JOIN("|", "^$",
IF(SEQUENCE(1, G2-F2)<=G2-F2, F2+SEQUENCE(1, G2-F2, 0), ))&"'", 0)), "♥", ))
demo sheet
Assuming the name of your first sheet with the full data is actually Sheet1, place the following in Sheet2 cell A4:
=FILTER(Sheet1!A2:B,Sheet1!A2:A<>"",(Sheet1!C2:C>G2)+(Sheet1!D2:D<F2))
The combined either/or condition (Sheet1!C2:C>G2)+(Sheet1!D2:D<F2) in the FILTER means "either the start date is after the range date given, or the end date is before the range date given."
The other condition of Sheet1!A2:A<>"" just rules out blank rows in the original data set. It's not strictly necessary as far as the visual results are concerned; but it keeps null rows from being added to those results, which would allow you to enter data below the results in Col A and B of Sheet2 if you wanted, or to have fewer rows in Sheet2 than in Sheet1 without the formula adding more rows to accommodate null returns.
Your posted sample data is unclear. You have two different names for the same ID (i.e., 00731). And you have an "End Date" in D5 of February 30, 2021—which is not a valid date. In any case, it's unclear whether the same person/ID may turn up twice in the original data set. My formula above assumes you will not.
If your original data list may, in fact, contain duplicates, things get a bit trickier. In that case, use the following formula instead, in Sheet2 cell A4:
=UNIQUE(FILTER(A2:B,ISERROR(VLOOKUP(A2:A,FILTER(A2:A,((C2:C>=F2)*(C2:C<=G2))+((D2:D>=F2)*(D2:D<=G2))),1,FALSE))))
Here, the inner FILTER first forms a list of all people who are working during that range, and then the outer FILTER filters in a UNIQUE set of the people who are not on that inner list (i.e., trying to VLOOKUP them returns IS(an)ERROR).

In Google sheets, How to do Vlookup unique data from multiple column

My Vlookup formula is the following currently:
(Weekly Consolidated Sheet)
Column C:1
=iferror(arrayformula(if(D:D="Item No.","Document No.",('For NAV'!C3:C))),"")
Column D:1
=iferror(arrayformula(if(A:A="Posting Date","Item No.",Unique('For NAV'!D2:D))),"")
Column I:1
=iferror(arrayformula(if(A:A="Posting Date","Quantity",sumif('For NAV'!D:D,D:D,'For NAV'!I:I))),"")
I would want to consolidate data from "For NAV" sheet into "Weekly Consolidated" Sheet.
"For NAV" Sheet has duplicate Item No. which I want to make it Unique and Sum the total Quantity (Column I)
Now that the document number seems to be the main Criteria I am stuck.
The following is what I need:
Main Criteria = Document No
Example:
ADW 01-07/03
-Item number which has same document number should consolidate its own Unique item number and sum the Quantity
ADW 08-14/03
-Item number which has same document number should consolidate its own Unique item number and sum the Quantity
Other columns is OK i can vlookup from "Item Listing" Sheet based on the Item code
Link for the spreadsheet as below:
https://docs.google.com/spreadsheets/d/1SL63pIF35skZjjbFjTRgfsbSYHvDr-gRRKciZbYFRUU/edit#gid=1168278681
Try changing your formula in I2 to
=ArrayFormula(iferror({"Quantity";sumif('For NAV'!C3:C&'For NAV'!D3:D,C2:C&D2:D,'For NAV'!I3:I)}))
The way this works is by making a unique string generated from the values on the C and D columns to compare between sheets. In this case you can simply joining them together because the the C column is always the same size.

How to get the top n category names from the first column based on the product id in the first row in google sheets?

So here I have the product Id in the first row and the category names in the first column.
And each column shows the sold percentage of these categories corresponding to the product id.
Now I want to see the top 3 category names based on the sold percentage with respect to product id.
Is there any way to do that? I have tried index match and filter functions and was not able to achieve the desired result and I am not that familiar with query function so did not venture in that direction.
Can anybody help me with this please?
I have attached a sample image here---> 1
Solution:
You can use a segmented QUERY with MATCH to check which column to sort the values from.
=QUERY({A1:H},"SELECT Col1"&" ORDER BY Col" &MATCH(K2,A1:H1,0)&" DESC LIMIT 3",0)
Sample:
Reference:
MATCH()
Query Language Reference
Use this formula
=SORTN(A3:A,2,1,B3:B,0)
You can get it by query as following with G2 contains the number of the column containing the parameter
=query({A1:D},"select Col1,Col" & G2 & " order by Col" & G2 & " desc limit 3")

How to join tables using Query or Vlookup

I have 2 sheets
people sheet has
[company first_name last_name full_name address_line1 address_city address_state address_zip address_country telephone email order_id order_date order_time processor order_type order_currency commission campaign_id]
sales sheet has
[DATE PROSPECT NAME EMAIL ADDRESS CONTACT METHOD PRODUCT RESULT NOTES ]
How do I make the report to generate when people.email = sales.EMAIL ADDRESS and display the records only if they match (Not all of sales sheet)
Report fields are
full_name
EMAIL ADDRESS
PRODUCT
commission
Sample File
Please try to use basic formula for joining sheets + query to skip some rows.
Basic formula:
=FILTER({Sales!B14:B,Sales!C14:C,Sales!E14:E, vlookup(Sales!E14:E,{People!B2:B,People!D2:D},2,), Sales!F14:F},Sales!A14:A<>"")
The formula you need:
=QUERY(FILTER({Sales!B14:B,Sales!C14:C,Sales!E14:E, IFERROR(vlookup(Sales!E14:E,{People!B2:B,People!D2:D},2,), "do not show"), Sales!F14:F},Sales!A14:A<>""),"select * where Col4 <> 'do not show'")
How it works
It uses iferror(expression, "do not show") to replace #N/A error with the text "do not show".
Then it uses query to hide rows with value "do not show":
"select * where Col4 <> 'do not show'"
Basic formula and the question is here
Notes about usage:
Sales!B14:B,Sales!C14:C,Sales!E14:E are some columns you need to select first
IFERROR(vlookup(Sales!E14:E,{People!B2:B,People!D2:D},2,) will return column from "People", it is column People!D2:D. Please note that columns Sales!E14:E and People!B2:B are both containing a key, in the sample it is e-mail list.
Sales!F14:F is a column to return next.
filter condition Sales!A14:A<>"" is to skip empty rows from original sheet. You may also add other conditions into a filter.
query part will shorten the report and skip values where keys (emails) do not match. You may add other conditions into a query.
Note. Query language in Google Sheets does not have joins, and provided solution is a workaround. It shows how to make a join with a help of vlookup function in Sheets.
The provided formula gathers rows from sheet "Sales" and makes vlookup to sheet "People". You also may want to make vice-versa report: collect data from "People" and 'vlookup` data from "Sales".
"Vice-versa" report:
=QUERY(FILTER({vlookup(People!B2:B ,{Sales!E14:E, Sales!B14:B, Sales!C14:C, Sales!E14:E},{2, 3, 4},), People!B2:B, IFERROR(vlookup(People!B2:B ,{Sales!E14:E, Sales!F14:F},2,),100500)},People!A2:A<>""),"select * where Col5 <> 100500")
note! In this formula used numeric value 100500 to skip values because query works with the single data type (number or text).
Please comment here if you have any questions about how it works.

Resources