So I'm having a problem with summing some data in a range with multiple criteria. Take the data below as an example:
I would like to sum all numbers where: Name = Bob AND the top row is equal to 02/01/20.
The current formula i have is with a SUMPRODUCT, but i'm not sure if it's the solution
=SUMPRODUCT((Names="Bob")*(Dates="02/01/2020")*Values)
Where Names is a named range for my names, Dates is a named range for my dates and Values is a named range for all my values in the table. However, the formula keeps resulting in "#VALUE!".
Any ideas anyone?
You need to turn your date string into a date value. So try:
=SUMPRODUCT((Names= "Bob")*(Dates=--"02/01/2020")*Values)
Related
I have a string in the cell A1 in sheet name Sheet 1.
I now use the MATCH function to find the string of cell A1 in the range A1:Z1 of a different sheet.
That works fine so far. The function returns the column number. (let's say 5, in column E)
My overall goal is to determine how many non-empty cells I have in a certain column. For that, I can use the COUNTA formula which expects a range as parameter. My problem is that I do not know how to convert the number of a column into a valid range without using VBA.
Manually I would do COUNTA(E:E) but I need to create a range for a numbered column like 5.
Thx.
Use INDEX:
=COUNTA(INDEX(Sheet2!A:Z,,MATCH(A1,Sheet2!A1:Z1,0)))
I am doing some excel staff, and now need an formula to calculate how many is same and mark them.
Example i have row with 10 cells and want to compare with row under how many same cells are.
I marked same fileds but i need formula which takes range F15:O15 and compare with range F6:O6 to check how many same in these cells.
Let's say your data is like this:
As you can see, only 3 cells are identical in both rows (range D4:F4 = range D5:F5)
The formula I've used in cell D8is:
=SUMPRODUCT(--(A1:J1=A2:J2))
And it returns 3 :)
Here is my problem .
I have an excel workbook with 2 sheets with the same fields but different amount of records. Both sheets have an ID field and date field.
If the ID from column a of sheet 2 exists in column a of sheet 1 then I want to use the date field from sheet 2 to populate the date field in sheet 1 for that matching ID.
Please help me figure this out. I can post sample data.
Thank you
As suggested by #L42 VLOOKUP can be used for your situation. A simple example mentioned below can guide you to adopt it to your situation.
There are four pieces of information that you will need in order to build the VLOOKUP syntax:
The value you want to look up, also called the lookup value.
The range where the lookup value is located. Remember that the lookup value should always be in the first column in the range for VLOOKUP to work correctly. For example, if your lookup value is in cell C2 then your range should start with C.
The column number in the range that contains the return value. For example, if you specify B2: D11 as the range, you should count B as the first column, C as the second, and so on.
Optionally, you can specify TRUE if you want an approximate match or FALSE if you want an exact match of the return value. If you don't specify anything, the default value will always be TRUE or approximate match.
Now put all of the above together as follows:
=VLOOKUP(lookup value, range containing the lookup value, the column number in the range containing the return value, optionally specify TRUE for approximate match or FALSE for an exact match).
In the sample data shown in the sheet1 and sheet2. Shee2 has ID column and Date column. Formula to be put in cell B2 of Sheet1 is:
=VLOOKUP($A2, Sheet2!$A$2:$B$6,2,0)
Fill down the formula and it will correctly pick dates from Sheet2 and fill in sheet1. Sample data screenshots are placed below.
I would like the average of a subset of values within a column in an Excel spreadsheet. For example, just those in the value range 10 to 11 within ColumnA containing many values. The result should be in a different column.
I suspect what you want (if a formula suits) is:
=AVERAGEIFS(A:A,A:A,">="&10,A:A,"<="&11)
I have an excel sheet with 6 columns. The first column has the customer name, the 5th column has a number that I want to get an average of for all occurrences of a specific customer name.
I have tried the AverageIf function, but I am not understanding what to use for the criteria since it itself is a range to find the customer names in column 1. Any ideas?
In the syntax for AVERAGEIF, the first range is the names, the second value is a cell where you put the specific customer name (could just be a quoted string), and the third value is the range of values to be averaged, so:
=AVERAGEIF(A1:A7,I20,E1:E7)