How to Aggregate All Values in a Worksheet for a Particular Unique ID (Google Sheets) - google-sheets

Assume that you have a worksheet that contains two columns: unique_id and variable_a. Assume further that there are multiple values in the worksheet for each unique_id (i.e. multiple rows that start with the same unique_id). Now, my task is to aggregate all of these values by unique_id. Per the recommendation in the comments, I use SUMIF(Sheet1!$A:$A,A2,Sheet1!$D:$D) to pull all of these values. However, some of the cells for variable_a are #N/A. Obviously, this returns a #NA for the SUMIF function as well. How can I edit the SUMIF function so that it does not include these #N/A values since I do not want to filter out and delete all rows containing #NA values in the original spreadsheet?
Sample Worksheet
Output Worksheet

You can use IF function and use Vlookup as a part of it... post the example requirement, I will share you the answer...

enter image description here
You can get from below one

Related

Unique Filter multiple sheets with ArrayFormula

I have no idea how to title this post, apologize in advance.
I have several sheets with a number in Column I and a name centered and merged in columns A:H. I want to obtain the name from A:H of the corresponding value within I but do have duplicates, therefore I need the nth value when permitted. The formula I have so far works up to the point it does not autofill down as an ArrayFormula, so when I drag the formula down I get an #REF! error due to the fact that when a duplicate is found it cannot overwrite the formula below.
This will be easier to showcase: LINK TO SHEET.
Essentially, in the main sheet all the values in I:I of all the other sheets are obtained and sorted, then using that column I want to return the name that corresponds to the value, allowing for duplicates to work themselves out. I believe my issues resides in the $B1 part at the end of the formula preventing it from being an array.
=ARRAYFORMULA(UNIQUE(FILTER({Sheet2!$A$1:$A;Sheet3!$A$1:$A;Sheet4!$A$1:$A},{Sheet2!$I$1:$I;Sheet3!$I$1:$I;Sheet4!$I$1:$I}=$B1)))
Cell F2 on the Sheet1 tab:
=QUERY({Sheet2!A:I;Sheet3!A:I;Sheet4!A:I},"select Col1,Col9 where Col9>0 order by Col9 asc",0)
You can read more about query here.

Formula for looking up and filtering data from a sheet

I want to do a complex formula using google sheets:
I have a list of place that will be visited by different people.
Some places are not to be visited, marked with /
Some places need to be assigned, marked with ?
Wanted outcome:
A list of cells that changes every day automatic.
An overview of who is going where that day and what needs to be assigned.
So I need a formula that can select a row based on today() and then filter out Persons in that row. Then for each person, another formula that looks up the first row in the table and puts duplicates together.
Example:
Wanted outcome:
Link to excel file, but it needs to work in google sheets too: xlsx
My solution is not the most elegant but it does the job.
First I build a column with date and unique persons or ? in this column:
=unique(sort(transpose(index(A1:H10,match(today(),A1:A10,0)))))
Then I find Places corresponding to these persons (I use filter function for it and then I use textjoin to keep them in single cell).
The formula is copied down as filter function does not accept a range and arrayformula as a filtering criterium.
My solution is available here:
https://docs.google.com/spreadsheets/d/1GTy_UaFP8LbA8OLnEhT_R_twpDCIWCuvQfBAigqtbR0/copy

How to use AVERAGEIF in Google Sheets, only addressing columns with a specific text

In Google Sheets, I'm trying to use AVERAGEIF to calculate an average of only some of the columns in another table.
The columns to be included in the average are marked by some text in a specific cell (e.g. the first or last row of that column).
Some columns are to be included in several averages, so the text in the top\bottom row would include several words (effectively meaning I'll need some sort of substring check such as FIND).
I've tried using AVERAGEIF() in conjuction with FIND() but couldn't get this to work.
Any ideas?
Here is an example of how the data sheet looks like, and how I would expect it to work
You can use following formula:
=ARRAYFORMULA(AVERAGE(IF(ISNUMBER(SEARCH(D2,A2:A9)),B2:B9,"")))
Edit:
For table mentioned in comment you must change ranges:
=ARRAYFORMULA(AVERAGE(IF(ISNUMBER(SEARCH(E2,$A$1:$C$1)),$A$2:$C$4,"")))
You can use a query
=AVERAGE(QUERY(TRANSPOSE($A$1:$D),"where Col1 contains '"&D1&"'"))
Functions used:
AVERAGE
QUERY
TRANSPOSE

Using VLOOKUP with an additional VLOOKUP on FALSE

I am trying to use vlookup in Google Sheets to populate my price data in my inventory database called "Food Inventory". The data I am looking to match is the "description" which is the A column in all three sheets.
I have a price data sheet with a named range pricedata and an Old Price Data sheet with a named range oldprice.
I would like to find the most current price data and if there is no match look in the Old price data sheet.
Here is the formula I am using which is not working:
=VLOOKUP(A3,PriceData,4,0),VLOOKUP(A3,oldprice,4,0)
I would prefer not to use array formulas, if possible.
Almost there but one can't link two VLOOKUPs with just a , in the way you attempted. If the first attempt (in PriceData) fails an error will be returned. This can be used to trigger the second attempt with IFERROR:
=iferror(VLOOKUP(A3,PriceData,4,0),VLOOKUP(A3,oldprice,4,0))

Is it possible to set a default value of zero when using COUNTA function in Google Sheets?

I'm using a pivot table in a Google Spreadsheet that counts the occurrences of different types of event-types on given dates. The events are listed on one sheet, with a column for "Date" and column for "Type." Based on this a Pivot Table is produced.
The trouble is that for dates when an event-type is non-existent, COUNTA returns empty. I'd rather it return 0.
The reason is for charting and statistical purposes when you create a chart from this data, it interpolates between values, ignoring empty cells. I'd prefer that it display zero on the chart on the days when these event types don't exist...
Is this possible?
UPD: sorry, I've misunderstood what you need.
What if, on another worksheet, you write the following?
=arrayformula(IF('PivotSheetName'!A1:Z100="";0;'PivotSheetName'!A1:Z100))
(This formula makes a copy of your Pivot table on the new worksheet,
replacing empty cells with 0; moreover, the control elements of the
pivot table are copied to the new worksheet as well)

Resources