Excel SUMPRODUCT is a remarkably versatile function with many uses. The aim of this tutorial is to reveal the full power of SUMPRODUCT and teach you how to compare arrays in a clever and elegant way, conditionally sum or count cells with multiple criteria, get a weighted average, and more. Continue reading
by
Comments page 2. Total comments: 123
Hello to all
I am trying to return the sum of the value from a specific column based on multiple criteria in a row and/ or column.
As an ex-example:
Database
Column A Column B Column C Column D
Row month date Type Project name Sales
Row 1 01/31/2022 Revenue1 Kansas 100
Row 2 03/22/2023 Revenue2 Texas 26
Row 3 01/23/2023 Revenue1 Kansas 150
Row 4 01/31/2023 Revenue1 Kansas 10
I need to create the sumproduct condition that will return the value 260, which is the sum Row 1, Row 3, and Row 4 based on the below criteria:
Q1-2023 (which will collect 01/23/2023 and 01/31/2023), Revenue1, Kansas as the project name.
I tried with the SUMIFS but the formula is static through a specific column.
Thank you in advance for your help.
Hello!
Please read the above article carefully. To calculate the sum by conditions, you can find useful information in this article - Excel SUMIFS and SUMIF with multiple criteria.
=SUMPRODUCT(--(A1:A4>=DATE(2023,1,1)),--(A1:A4<=DATE(2023,3,31)),--(B1:B4="Revenue1"),--(C1:C4="Kansas"),D1:D4)
=SUMIFS(D1:D4,A1:A4,">="&DATE(2023,1,1),A1:A4,"<="&DATE(2023,3,31),B1:B4,"Revenue1",C1:C4,"Kansas")
Thank you, Alexander,
Thank you for the recommendation and guidance; however, how can I get the formula to search first a specific title of a column and then have the research done?
As an example, the column "type" in the current formula is selected as an array (B1:B4="Revenue1) . Can it be possible to have a condition that search first a specific labeled column (in this case, "type" and then at this time indirectly take a chosen additional criteria in this now found column ("Revenue1") and continue the formula as you explained (-(C1:C4="Kansas"),D1:D4))
Thank you again for all your help.
JP
Hi, this formula:
=SUMPRODUCT(--ISNUMBER(SEARCH(B3&" for ",Description)))*Cost
is returning required value. I want to add a second criteria to return value based on date range. So I changed formula to:
=SUMPRODUCT(--(ISNUMBER(SEARCH(B3&" for ",Description))),--(Date,">="&$D$1,Date,"<="&EOMONTH($D$1,0))*Cost)
Unfortunately, formula is returning #VALUE. It looks like the date part of formula is generating the #VALUE error. Could you take a look please?
Your help is greatly appreciated.
Hello!
Use this example to add a date range to the SUMPRODUCT function
=SUMPRODUCT(--(A1:A10>=$D$1),--(A1:A10<=EOMONTH($D$1,0)))
I hope it’ll be helpful.
Thanks for help.
Hello, I am interested in adding a formula to my excel to reflect if this cells has a specific month or date range, to sum this column.
ex:
A B C D E
CC-234-10-31-2022 VIROLOGY 101001 VIROLO 10/31/2022 235.17
CC-234-10-12-0222 PARASITOLOGY 101001 PARAST 10/12/2022 324.00
CC-234-10-11-0222 PARASITOLOGY 101001 PARAST 10/11/2022 324.00
CC-234-10-10-0222 PARASITOLOGY 101001 PARAST 10/10/2022 324.00
CC-234-10-09-0222 PARASITOLOGY 101001 PARAST 10/9/2022 324.00
CC-234-10-03-0222 PARASITOLOGY 101001 PARAST 10/3/2022 324.00
if column D has a date between 10/1/2022 and 10/31/2022 (or just the month 10; whichever is easier), sum up column E.
Hello!
To calculate the sum of values in a date range, use this tutorial: SUMIF with dates.
This should solve your task.
Manager Name : Daily Attendance'!$F$4:$F$154
Dates: Daily Attendance'!$G$4:$AK$4
B3=Manager Name, B5= date
Daily attendance of the resources marked as (Present(P), Absent(A), Approved Leave(AL), Unplanned Leave(UL) etc..) in Daily Attendance'!$g$5:$AK$154 range
=SUMPRODUCT(('Daily Attendance'!$F$4:$F$154=B5)*('Daily Attendance'!$G$4:$AK$4=$B$3),(COUNTIFS(G$4:G$154,"P")+COUNTIFS(G$4:G$154,"PNS")))
Here, (COUNTIFS(G$4:G$154,"P")+COUNTIFS(G$4:G$154,"PNS"))) this is not a number value hence formula isn't working.
Kindly help me to get count of attendance marked from Daily Attendance'!$g$5:$AK$154 range for a particular manager for a specific date
Thank you for your quick response Alexander !
Sorry, below is the range from which I am trying to get the count of Present (P) + PNS
(COUNTIFS('Daily Attendance'!$G$4:$AK$154,"P")+COUNTIFS('Daily Attendance'!$G$4:$AK$154,"PNS")))
Hello. I want to use sumproduct with multiple criteria but the value of one criterion might be located in multiple rows. Ideally I would like to use something such as :
=SUMPRODUCT(($C$50:$DQ$50="Theoretical")*($C$11:$DQ$122=$H8)*($H$11:$H$122=Summary!D$6),'Sheet1 (62)'!$C$11:$DQ$122)
but the ($C$11:$DQ$122=$H8) makes the formula to give 0. Is there any other way of searching that H8 value in multiple rows and columns?
Hello!
All ranges in the SUMPRODUCT formula must be the same size. You cannot multiply matrices with different numbers of rows or columns.
Hello again. They have the same range. The table is from C11 till DQ122. My question is if it is possible to apply criteria within many columns AND rows instead for either rows or columns
Hi!
Are $C$50:$DQ$50 and $C$11:$DQ$122 and $H$11:$H$122 have the same range?
But when I put the formula below it is not giving an error:
=SUMPRODUCT(($C$50:$DQ$50="Theoretical")*($C$11:$DQ$11=$H7)*($H$11:$H$122=D$2),$C$11:$DQ$122) while the H$11:H$122 is not the same as C$50:DQ$50. But they refer to only one column or only one row
Hello!
I need some help also :)
I have a huge table with:
Columns:
- two columns with parameters: ColSupplier = supplier, ColProject = Project
- many columns with weekly production outputs (1 column / week) - so I have 3 lines of parameters to define one column: year (LinYear) + quarter (LinQtr) + week number
I need to sum up per supplier and per project the production output by quarter or by year.
I have managed to reach out to the right "first cell" cells with "INDEX/MATCH function":
=INDEX(DataTable,MATCH(1,(ColSupplier="Supplier 1"*(ColProj="Project A"),0), MATCH(1,(LinYear="2023")*(LinQtr="Q2"),0)))
But I need to sum up all production outputs over the full quarter (up to 13 weeks = 13 columns), and not only revert the first weekly output Excel is finding. I try adding SUM in front of INDEX but it does not work.
Thanks in advance for your support!
Best regards
Serge
Hello!
I hope this example formula will show you the solution using your data. Multiply the conditioned matrix and the data matrix and use the SUM function to calculate the quarterly sum.
=SUM(((A4:A10="Supplier 1")*(B4:B10="Project A")) * ((C2:G2="Q2")*(C1:G1=2023)) * C4:G10)
I hope I answered your question. If something is still unclear, please feel free to ask.
Great, it is working perfectly, thanks a lot!
I have hundreds of rows of data on a worksheet. I can use filters to glean the counts of items, but I have used sumproduct to do this in the past. Unfortunately, I lost the complex formula string when I changed computers. I am attempting to get a count of items that match multiple criteria in the columns. For example, see below, I am attempting to gather a count of items using the Name, Class, Location, and Style. I recall using "--" between the SUMPRODUCT functions to narrow down the retrieved data and displayed it as the output. For example, using SUMPRODUCT I would like to get the count of Names that are a specific Location that have a specific Size. Thank you ...
Name | Class | Location | Size
Joe | Third | AZ | Large
Bill | First | NJ | Med
Francis | Third | AZ | X-Large
Harry | First | NV | Med
Hello!
If I understand your task correctly, the following tutorial should help: Conditionally count / sum / average cells with multiple criteria.
I hope it’ll be helpful. If something is still unclear, please feel free to ask.
Hello Alexander!
Thank you! The tutorial provided the information required to complete the task in Excel.
Hello Alexander,
I need help please.
I have 3 columns (A-B-C):
A has 12 records both text and numerical;
B has 10,000 records TEXT format;
C has 10,000 records TEXT and NUMERIC format;
I need to COUNT records in the column "B", IF column "C" MATCH column "A". As you can see, both Column "B" and "C" have a direct correlation (in other words it is one table).
Please note, the COUNT formula cannot be referenced each individual "CELL" 12 times from the column "A". I will need to copy the formula to other files, and sometimes there will be 5 records in column "A", sometimes 15, or even 25. The idea for this formula is to change the "RANGE" only, based on column "A" records from one file to another.
Any help is greatly appreciated.
Hello!
To count the number of records by multiple criteria, use the SUMPRODUCT function:
=SUMPRODUCT(--ISNUMBER(MATCH($C$1:$C$100,$A$1:$A$30,0)), --($B$1:$B$100<>""))
Hope this is what you need.
Unfortunately, I could not find any simple examples using MATCH with SUMPRODUCT.
Thank you Alexander, your formula worked.
Hello all,
I'm trying to do a stack ranking based on performance that are weighted differently. I have 9 measurements that fall into three groupings, Management, Wallet share, and quality. Should I sum the stack ranking of each grouping to get the weighted score and then use the sumproduct formula so that I can get a total stack ranking?
The weighting is 30% Management, 30% wallet, and 40% for quality.
Hello!
Try to use the recommendations described in this article: How to calculate weighted average in Excel. I hope I answered your question. If something is still unclear, please feel free to ask.
Hello - I am trying to calculate the 75th percentile of a weighted average. When I combine the percentile and sumproduct, it seems to only return the sumproduct. The values I am using are 1) column with number of incumbents; and 2) the salary for each. In the example below, I believe the answer should be $118,206, but sumproduct keeps returning the answer of $123,278 - this is the weighted average, but I need the 75th percentile of the weighted average. Thanks.
Inc Salaries
17 111,043
1 111,298
1 118,206
1 135,200
1 151,388
1 162,136
1 163,865
1 166,462
1 185,661
Hello!
You can only calculate the percentile from one column of values. Use PERCENTILE function.
You can also use this formula.
=RANK.EQ(B1,$B$1:$B$9,1)/COUNT($B$1:$B$9)
Write it in C1 and copy it down the column to calculate all rank percentiles.
I am trying to figure out how to use the SUMPRODUCT formula to count the number of times an event happens within each month (JAN-DEC). If the value from another sheet cites FRONT (Front door), it will add it as part of a total within that month
=SUMPRODUCT((Data!C662:C2002="FRONT"))
OR
=SUMPRODUCT((MONTH(Data!A662:A2002)=1)*(YEAR(Data!A662:A2002)=2022)*(Data!E662:E2002="FRONT"))
Hello!
You are making mistakes in the syntax of the SUMPRODUCT function. Read carefully the first paragraph of this article. Also convert logical expressions to numbers. This is also described above.
=SUMPRODUCT(--(MONTH(Data!A662:A2002)=1),--(YEAR(Data!A662:A2002)=2022),--(Data!E662:E2002=”FRONT”))
Do you have dates and text in the same column?
18 37 422.73
1 2 1006.08
2 1 811.62
3 2 1352.71
Hi - I am trying to do a sumproduct of A and C plus a sumproduct of 50% of the values in B and C, but I do not want to create a new column showing the 50%. The answer with the numbers above would be 24,881.695. I really hope this is possible!! THANK YOU!
Hi!
Please try the following formula:
=SUMPRODUCT(A1:A4,C1:C4) + 0.5*SUMPRODUCT(B1:B4,C1:C4)
I hope it’ll be helpful.
THANK YOU!!
I'm so sorry - I read this and it confused me. Trying again! :)
18 37 422.73
1 2 1006.08
2 1 811.62
3 2 1352.71
I want to do
sumproduct($A$1:$A$4,$C$1:$C$4)+sumproduct($C$1:$C$4,((0.5*$B$1:$B$4))
but this gives an answer I do not expect (21,444.89) instead of 24,881.695.
how come ther is no goto command in spreadsheets for exaple
cell a1 input a1
cell a2 if a1 = "home" the goto d1
cell c1 'go
cell c1 c2 = a1
answer
go home
how come we do not have that formulas in spreadshet
Hi!
For conditional calculations, you can use the IF function.
Or use VBA language.
Hello,
Type Sub Code Amount Product
Cost 100 20 A
Sale 100 30 A
Cost 200 40 A
Sale 200 50 A
Sale 300 60 B
I am trying to divide Cost/Sale to find the Percentage for a product group but by each sub code. For example Product A, Sub Code 100: 20/30 + Product A, Sub Code 200: 40/50 and then get the total percentage. I am able to do the divide for the total amount by Product, but I want the divide function to run for each sub code separately and then add it to get to the total Percentage
Hello!
The location of your data makes it very difficult to do the calculations you need.
You can get the corresponding Sale values in column E using the INDEX+MATCH formula:
=INDEX($C$2:$C$6,MATCH(D2&B2&"Sale",$D$2:$D$6&$B$2:$B$6&$A$2:$A$6,0))
After that, you can divide the desired values from column C by column E, and also calculate percentages.
Hi, I think this one might be easy for you, on my side I have been trying for some times now. I would like to create a SUM formula that I can drag down over hundreds of rows that could SUM some figures from the same column depending of the title of this collumn and what is written in the rows. I am not so sure if sumproduct if the best, I would like not to use Sumifs as it would be unreadable and multiple lines of formulas.
Let's imagine;
Collumn A : Shop 1, Shop 2, Shop 3
Collumn B : pear, apple, cherry, apple, cherry, orange, pear
Column C : small, medium, big, small, medium, big, huge.
collumn D : 1st year
Collumn E : 2nd year
Collumn F : 3rd year
collumn G : 4th year
For the rows Collumn A to C, it would be as described: shop, product, size (over 1xxx rows)
and Collumn D to G we will have the quantities sold. (historical TAB that can't be upgraded easily...)
Then, what I would like is in another TAB and in 1formula, to sum the figures depending of the year the product, the size and the shop.
Again, I know I could use sumifs (I think ><), but I would like to avoid that. maybe sumproduct is not the best, wish you could help me on this one.
Thank you very very much for your help and time.
Remy
Hello!
If you want to sum values based on a column heading, then I recommend using a pivot table. There, on a separate sheet, you can choose which column you want to summarize and by what criteria.
Hi,
Thank you for your answer, I will try that.
Hiya
I am trying to work with three separate columns of data, ie.
A B C
Red 31 5
Blue 29 10
Yellow 50 20
Green 29 15
Red 31 50
What I am trying to accomplish is I want to be able to work out for each variable in Column A whether it is equal to 31 in column B and if it is then count those in column C on the same row but exclude everything else?
So as above Red = 55, Blue = 0, Yellow = 0, Green = 0.
I have approximately 60000 lines of data.
Your help is very much appreciated!
Hello!
To find the sum of values across multiple criteria, use the SUMIFS function as described in this tutorial.
This should solve your task.
Hello,
I appreciate the help to use SUMPRODUCT() to calculate the weighted average (Weight & Cost) but only if the value (Center) is found within a designated range of cells.
In the example below, I would like to obtain the WAvg for Set 1 and Set 2. The actual data set is thousand of entries and hundreds of centers, resulting in numerous Sets. Single entry such as if ="apple" OR "lemon" as shown in the lesson will not be feasible to process the large volume. Is it possible for the conditional statement to be a cell range instead of individual values?
Thank you for the help!
Set 1: Centers 949 and 1200
Set 2: Centers 5300 and 3687
Weight Cost Center
5 12380 949
2 90375 1200
3 38306 1200
4 49073 949
5 41498 5300
6 35196 3687
6 28948 949
5 83636 5300
1 21753 5300
1 53236 1200
Hello!
Add conditions to the SUMPRODUCT formula:
=SUMPRODUCT(A2:A11,B2:B11,--(C2:C11>=949),--(C2:C11<=1200))/SUMPRODUCT(A2:A11,--(C2:C11>=949),--(C2:C11<=1200))
I hope my advice will help you solve your task.
Can SUMPRODUCT be used in the case where column A1:A100 has an hourly rate and Column B1:B100 has # hours and I want to multiply the rate by #hours for each 3rd row in the array? For instance, a quicker way to write (A1*B1)+(A4*B4)+(A7*B7)... The scenario is that I have multiple people on the project and each bills a different rate. Each week I need to summarize the total burn rate.
Hello!
If your data starts on line 2, then in order to find the sum of the products in every third line, you can use the formula:
=SUMPRODUCT(A2:A10,B2:B10,--(MOD(ROW(A2:A10)+1,3)=0))
I hope I answered your question. If something is still unclear, please feel free to ask.
SECURITY PREV_CL_PR OPEN_PRICE HIGH_PRICE LOW_PRICE
3M INDIA LIMITED 18399.7 18401.95 18426 18190.05
63 MOONS TECHNOLOGIES LTD 68.65 68.75 69.4 68.1
3M INDIA LIMITED 18307.15 18450 18500 18151.05
63 MOONS TECHNOLOGIES LTD 68.35 68.65 71.75 67.15
3M INDIA LIMITED 19353.15 19400 19612 19100
63 MOONS TECHNOLOGIES LTD 78 78 79.9 76.25
3M INDIA LIMITED 18747.5 18750 18949.9 18130.55
3P LAND HOLDINGS LIMITED 6.65 6.35 6.35 6.35
63 MOONS TECHNOLOGIES LTD 75.75 74.2 78 72.25
got high price by max function but not able find the low price by min function
=SUMPRODUCT(MAX((D2:D12000) * (A2:A12000=A2) ))
but same in min function gives 0
=SUMPRODUCT(MIN((D2:D12000) * (A2:A12000=A2) ))
Hello!
I believe the following formula will help you solve your task:
=MINIFS(D2:D12000,A2:A12000,A2)
You can learn more about MINIFS in Excel on our blog.
Was looking at a database set-up by someone and long gone; came across this formula:
=SUMPRODUCT(--(DELIVERY[DATE]<$C$3),DELIVERY[105MM BAG])-SUMPRODUCT(--(DELIVERY[DATE]<$C$1),DELIVERY[105MM BAG])
Please help me understand what this formula means in words as seen in the examples above.
Note: "C3" is a date - start of a new month
"C1" is a date - start of the previous month or just ended
"Delivery" - The worksheet name
"105MM BAG" - Title of a column in the Delivery worksheet and product being counted
Hello!
If I understand your task correctly, the formula calculates the amount for the previous month
This formula works for 2 criteria, Region and Name...
'=SUMPRODUCT((($D$1:$O$1>=$Q$1)*($D$1:$O$1<=$R$1))*($A$2:$A$49=$S$1)*($C$2:$C$49=$U1)*$D$2:$O$49)
Hello Eric,
Our blog engine sometimes mangles comments, sorry for this.
Your formula won't work, firstly, because D1:O1 (text values) cannot be compared to Q1 and R1 (dates); and secondly because the ranges ($D$1:$O$1, $A$2:$A$49, etc.) are of different size.
If, in your summary table (Q1 or R1), you enter the target month exactly as it is written in $D$1:$O$1, then the task can be accomplished with an array formula that you can find in this sample sheet.
Hello, what functions should I use to count the number of items that the North sell? (My table contains around 1000 rows, it scares me somehow, please help). Thank you.
A B C
1 Sl No Name No of Items
2 1 North 20
3 2 Divakara 25
4 3 Suhasini 100
5 4 North 88
6 5 Soumya 101
The forumula to count the number of items that the North sell is:
=sumif(B2:B6,"North", C2:C6). It will return answer 108.
What is the correct sumproduct formula to calculate the total amount for account=1217000 and fy=18? I have tried the following, which calculates a result of 0, not 50,000.00:
=SUMPRODUCT((A6:A31="1217000")*(B6:B31="17")*(C6:C31))
Here is the worksheet.
Line 6 begins at the first row containing the numbers.
A B C
Account FY Amount
1210000 17 50,000.00
1217000 17 25,000.00
1210000 15 300,000.00
1212080 18 25,000.00
1217000 05 100,000.00
1212080 18 100,000.00
1210000 05 6,947.35
1212080 18 50,000.00
1212023 18 67,950.00
1217000 18 50,000.00
1210000 16 1,800,000.00
1210000 17 150,000.00
1210000 18 500,000.00
1212080 18 25,000.00
1212020 17 5,000.00
1210000 18 100,000.00
1210000 17 25,000.00
1212016 17 170,000.00
1212025 18 150,000.00
1210000 17 5,000.00
1217000 17 25,000.00
1212080 18 10,000.00
1217000 14 5,000,000.00
1217000 17 500,000.00
1212015 17 1,000,000.00
1212026 17 50,000.00
This has been driving me crazy.
Thanks.
Hi Paul
Today I read your problem.
Simply remove the quotes from the values
=SUMPRODUCT((A6:A31=1217000)*(B6:B31=17)*(C6:C31))
Regards
Hi, thank you so much, this page was a great help. I have one case that I need some help. I noticed that when I use sumproduct with an OR connection, the values provided are not TRUE or FALSE (e.g. TRUE,FALSE+TRUE,FALSE resulting in {2,0}) How can I have a TRUE/FALSE output?
I want to know in how many rows either or both of the conditions appear, and not the count of every occurance.
Thank you for your help!
hello, I found a solution, the resulting array e.g. {2,0} can be adapted like this: --{2,0}>0 to result in {1,0}
=SUMPRODUCT(--('Excel - Full Data'!$D$4:$D$2100="WCCI"),('Excel - Full Data'!$K$4:$K$2100>0)*('Excel - Full Data'!$K$4:$K$2100<5000)*('Excel - Full Data'!$K$4:$K$2100))
Am I able to add an Additional parameter which includes "WCCI - TS" to the "WCCI" for $D$4:$D$$2100 range?
Any help would be greatly appreciated
Hello,
If I understand your task correctly, please try the following formula:
=SUMPRODUCT((('Excel - Full Data'!$D$4:$D$2100="WCCI")+('Excel - Full Data'!$D$4:$D$2100="WCCI - TS")),('Excel - Full Data'!$K$4:$K$2100>0)*('Excel - Full Data'!$K$4:$K$2100<5000)*('Excel - Full Data'!$K$4:$K$2100))
Hope this will work for you
Hi Guys,
I need some help in excel formula
I have some data with city name and numbers so just i wanted to identify the only unique values using only formula.
Data is like that
A B
City Number
A 123
B 456
A 678
A 123
Thanks in advance!
Hello, Amol,
To highlight the unique values, please select the column with the data, then on the Home tab, in the Styles group, click Conditional Formatting > Highlight Cells Rules > Duplicate Values. In the next pop-up window select Unique, choose the colour and press OK.
You can learn more on how to apply conditional formatting for uniques or duplicates in this article.
Please note that if you want to use the formulas, the values will be either simply counted or transferred to another columns. If this is what you need, please specify.
funny site not accept formulas in text..
SUMPRODUCT((F9lessthan{0.01,1,5})
ASTERISK
parenthesisMIN(M9:N9)greaterthan{1,3,9}))
Nice workaround to assist with a formula, Dave!
Thanks for your persistence! :)
I've never been good with sumproduct, and I think it's the answer to my problem but I can't get it to work! I want to add up everything with an account number that begins with 7, easy enough except that there are spaces in front of the account and the number of spaces is always different. So I want to basically do SUMPRODUCT(LEFT(TRIM($A:$A),1)="7"),$B:$B). The amounts are in Column B and the criteria is in Column A. I can't get this to work for the life of me!!
=SUMPRODUCT((LEFT(TRIM($A:$A),1)="7")*1,$B:$B)
I have many employees in my spread sheet , am just giving some sample date here . I have to find the min and max time for each employee and for each date . How can I do that.
Employee date time
e1 1-Jan-13 8:10
e1 2-Jan-13 8:00
e1 2-Jan-13 9:00
e1 2-Jan-13 10:00
e1 2-Jan-13 11:00
e1 1-Jan-13 16:00
E2 2-Jan-13 8:10
E2 2-Jan-13 8:00
E2 2-Jan-13 9:00
E2 2-Jan-13 10:00
E2 2-Jan-13 11:00
E2 1-Jan-13 17:00
Employee ID is in range $A$1:$A$12, date is in range $B$1:$B$12 and time is in range $C$1:$C$12.
Look up Employee ID is e2 and look up date is f2.
max time:=SUMPRODUCT(MAX((($A$1:$A$12=E2)*1)*(($B$1:$B$12=F2)*1)*$C$1:$C$12))
min time:=SUMPRODUCT(MIN(((($A$1:$A$12E2)*100)+(($A$1:$A$12=E2)*1))*((($B$1:$B$12F2)*100)+(($B$1:$B$12=F2)*1))*$C$1:$C$12))
Hello all,
I am trying to write a formula for the following conditions in excel.
Penalties(Days) Penalty per violation
1-14 $1,000
15-30 $2,000
31-60 $3,000
61-180 $4,000
>180 $5,000
Please help me to write a formula to calculate total penalties incurred based on the number of days of delay.
Thanks
Rama
Dear Rama,
Try the function VLOOKUP:
1) make up a simple reference table of two columns - Days and Penalty;
2) in the Days column insert a number that is equal to the right border of each range plus 1:
1 1000
15 2000
31 3000
61 4000
181 5000
3) convert your reference table into a named range, for example, Days_to_Penalty;
4) use VLOOKUP(number_of_days; Days_to_Penalty; 2; 1);
5) it's the last argument (1) that makes VLOOKUP search NOT the exact values.
I have this formula in cell F3 in my table
=SUMPRODUCT((TEXT($I:$I,"mm-yyyy")="01-2016")*1) and it works great
I would like to change the ="01-2016")*1)to reference cells in the next column so F3 would reference E3, F4 - E4 and so on but I can not seem to do it can you please help
Try this;
=SUMPRODUCT(--($I:$I=G3))
G3 is the ref cell that brings dynamical selection to the sumproduct formula