Excel sum different columns if criteria meet - excel

I need help to sum some numbers for specific criteria.
In Status table,under ID WR, when I enter specific number, what I predifined in Vlook table, I get all data what I need, except quantity what I must enter manualy and that is all fine.
My question wuld be: How to sum specific ID WR with quantity for that ID.
Example:
ID WR 8.1 >> how much is total sum for 8.1(not count).
Status table
Vlook table
Edit:
I put excel file(Link).On 3 table in excell i wuld need to sum those ID WR.
Excell table file

Assuming on your Status worksheet, quantity is in column E, and your ID WR in column A. On your lookup worksheet you would use the following formula (assuming A1 is the ID WR that you want to lookup):
=SUMIF(Status!$A$1:$A$20;A1;Status!$E$1:$E$20)

Fix the range and try:
=SUMIF(Status!$A$2:$F$5,Vlook!A3,Status!$F$2:$F$5)

Related

Number occurrences in another cell (Excell) [duplicate]

I have simple problem, but I've not be able to get an answer from searching. I require a column to calculate the number of the nth occurrence of a value. It's best explained in this picture
I require a method to calculate column B.
I'd be very grateful for any help.
Are you looking to merely provide a count of the distinct entries of column A in column B? Or merely add a formula to come up with the table in your link?
If the latter, then the formula to write in cell B2 is:
=COUNTIF(A$2:A2,A2)
then copy/paste it down column B. Note - if your data is both a Date and Time, but the cell is formatted to only display a date, you may not get the results you want. You'd need to interject a new column with a "floor" calculation to round the date/time value to a date (Excel date times are decimal, with integer part dictating the date, and remaining 0.0 -> 1.0 dictating the time of day)
If you just want to derive a table of the counts of distinct entries in column A, then a pivot table will do this for you - simple add a pivot table to cover the data in column A, then select column A into the rows category, and then also drag it into the values category, ensuring the field is set to "Count of". You should then have a table with the distinct entries in your data set in one column, and the count of their occurrences in the other column.
You can use the COUNTIF worksheet function, with a relative address.
Eg. In cell B2, enter this formula:
=COUNTIF(A$2:A2,A2)
And then fill-down.
Use the following formula to generate the required series:
=COUNTIF($A$1:A1,A1) and strech(copy) it in all the cells
This will generate result like this:
A 1 COUNTIF($A$1:A1,A1)
A 2 COUNTIF($A$1:A2,A2)
C 1 COUNTIF($A$1:A3,A3)
C 2 COUNTIF($A$1:A4,A4)
B 1 COUNTIF($A$1:A5,A5)
B 2 COUNTIF($A$1:A6,A6)
A 3 COUNTIF($A$1:A7,A7)
C 3 COUNTIF($A$1:A8,A8)
D 1 COUNTIF($A$1:A9,A9)
D 2 COUNTIF($A$1:A10,A10)
D 3 COUNTIF($A$1:A11,A11)
D 4 COUNTIF($A$1:A12,A12)

Use dynamic sum range and criteria range in SUMIFS

I'm using SUMIFS to calculate sales revenue of product X over a period of time. The problem is that all the sum range and the criteria ranges are dynamic since sales reps will add more rows to record new sales everyday. My formula looks like this:
=SUMIFS(Revenue!I5:I24,Revenue!F5:F24,"Product X",Revenue!B5:B24,">="&B3,Revenue!B5:B24,"<="&C3)
The starting row is row 5, and the last row that currently has data is row 24.
Revenue is the worksheet that contains the data. In this worksheet, column I is the revenue, column F is the product name, column B is the date that the revenue is recorded. B3 and C3 are the start and end date of the period.
When a sales rep records a new revenue, the last row that has data will become row 25, so my formula won't count it in. I tried to replaced 24 with 1000 hoping that it would count when new data was added beneath, but it returned #VALUE.
What should I do?
Thank you
Declare 3 dynamic ranges and use their names in your formula.
=IFERROR(SUMIFS(revenueI,revenueF,"Product X",revenueB,">="&B3,revenueB,"<="&C3),"")
Adding the names: Press Ctrl+F3 to open the name manager and then enter the 3 names
Name: revenueB
RefersTo=
OFFSET(Revenue!$B$5,0,0,COUNTA(Revenue!$B$5:$B$1048576),1)
Name: revenueF
RefersTo=
=OFFSET(Revenue!$F$5,0,0,COUNTA(Revenue!$F$5:$F$1048576),1)
Name: revenueI
RefersTo=
=OFFSET(Revenue!$I$5,0,0,COUNTA(Revenue!$I$5:$I$1048576),1)
1048576 is for the max number of rows in more recent versions of Excel. Adjust to the total number of rows for your Excel version.
Wrap in an IFERROR in case of errors e.g. if named ranges are off different length.

Sum of specific number of rows for a id in excel

I am pretty new to excel formulas. I want to calculate the sum of prices for every unique id. Using SUMIF I was able to do that for every unique id but I only want to calculate the sum of a number of rows for that id.
=SumIF(A:A;C2;B:B)
Sample data is attached. Actual data set is quite large. For Example, For Id 1, I only want to calculate the sum of first 3 rows (Column price) corressponding to that id, for id 2 the sum of first 4 rows and so on.
Sample data:
This formula works for sorted and non sorted data:
=SUMIF($A$2:INDEX(A:A,AGGREGATE(15,6,ROW($A$2:$A$20)/($A$2:$A$20=C2),D2)),C2,$B$2:INDEX(B:B,AGGREGATE(15,6,ROW($A$2:$A$20)/($A$2:$A$20=C2),D2)))
Enter this as an array formula (ctrl+shift+enter):
=IFERROR(SUMPRODUCT(IF(ROW($A$2:$A$20)>SMALL(IF($A$2:$A$20=C2,ROW($A$2:$A$20),FALSE),MIN(D2,COUNTIF($A$2:$A$20,C2))),0,1),IF($A$2:$A$20=C2,1,0),$B$2:$B$20),0)

Calculate Occurrence Number - Excel

I have simple problem, but I've not be able to get an answer from searching. I require a column to calculate the number of the nth occurrence of a value. It's best explained in this picture
I require a method to calculate column B.
I'd be very grateful for any help.
Are you looking to merely provide a count of the distinct entries of column A in column B? Or merely add a formula to come up with the table in your link?
If the latter, then the formula to write in cell B2 is:
=COUNTIF(A$2:A2,A2)
then copy/paste it down column B. Note - if your data is both a Date and Time, but the cell is formatted to only display a date, you may not get the results you want. You'd need to interject a new column with a "floor" calculation to round the date/time value to a date (Excel date times are decimal, with integer part dictating the date, and remaining 0.0 -> 1.0 dictating the time of day)
If you just want to derive a table of the counts of distinct entries in column A, then a pivot table will do this for you - simple add a pivot table to cover the data in column A, then select column A into the rows category, and then also drag it into the values category, ensuring the field is set to "Count of". You should then have a table with the distinct entries in your data set in one column, and the count of their occurrences in the other column.
You can use the COUNTIF worksheet function, with a relative address.
Eg. In cell B2, enter this formula:
=COUNTIF(A$2:A2,A2)
And then fill-down.
Use the following formula to generate the required series:
=COUNTIF($A$1:A1,A1) and strech(copy) it in all the cells
This will generate result like this:
A 1 COUNTIF($A$1:A1,A1)
A 2 COUNTIF($A$1:A2,A2)
C 1 COUNTIF($A$1:A3,A3)
C 2 COUNTIF($A$1:A4,A4)
B 1 COUNTIF($A$1:A5,A5)
B 2 COUNTIF($A$1:A6,A6)
A 3 COUNTIF($A$1:A7,A7)
C 3 COUNTIF($A$1:A8,A8)
D 1 COUNTIF($A$1:A9,A9)
D 2 COUNTIF($A$1:A10,A10)
D 3 COUNTIF($A$1:A11,A11)
D 4 COUNTIF($A$1:A12,A12)

Excel 2010: Vlookup Name from one column & Count and return data from another column

Hoping someone can help me here. :)
I have two columns of data in Worksheet 1:
COLUMN A = NAME (EG. TOM)
COLUMN C = TYPE OF QUERY (FAX, TEL, EMAIL, MAIL)
I would like to have in Worksheet 2:
COLUMN A = NAME (EG TOM)
COLUMN B = A COUNT OF HOW MANY FAXES TOM HAS
COLUNN C = A COUNT OF HOW MANY TELEPHONES TOM HAS
COLUMN D - A COUNT OF HOW MANY EMAILS TOM HAS
COLUMN E = A COUNT OF HOW MANY MAILS TOM HAS
If anyone can help me that would be great.
Thanks guys
You can use a pivot table. In sheet 1, click into the data table, then click Insert > Pivot table.
Drag the Name field to the rows. Drag the query type field to the columns.
Drag the Namie field again, this time to the Values area, where it will turn into a count.
Now you see a count of query types for each name in a matrix.
Use countifs instead if you really want to use formula. A pivot table would be the best way to go though.
eg for column B, row 1 on sheet 2:
=COUNTIFS(Sheet1!A:A, A1, Sheet1!C:C, "FAX")

Resources