Creating SUMIF Funtion
Jun 30, 2009I am looking for the exact code to make a "SUMIF" function so that I can modify it to add another search criteria, such that I only wan the sum if it finds both in the range.
View 9 RepliesI am looking for the exact code to make a "SUMIF" function so that I can modify it to add another search criteria, such that I only wan the sum if it finds both in the range.
View 9 RepliesI want to create a SumIf, but it has to satisfy two conditions, rather than the usual 1.
So in the case of the regular sum if I would
Sum up column C, if column A contained a person's name.
NOW, I want to
Sum of Column C only if column A contains the persons name, AND the entry in column B is >0.
Range("A1:F50").select
If Len(Cells.value) > 40 Then
activecell.clearcontents
End If
If I have column A with a department name e.g. A, B, C, etc
and
column B with a date next to the some of the entries of column A.
How would I compose a formula to return an answer of the amount of records that show column A as "A" and column B as "1".
This is probably immensely simple and I have a wet fish on standby to hit myself with.
I created a spreadsheet to calculate property "Return on Investments" (ROI). I then added a column with the If command. Here is an example formula:
=IF(AND(G12>=G4; G12>=G5; G12>=G6; G12>=G7; G12>=G8; G12>=G9; G12>=G10; G12>=G11; G12>=G13; G12>=G14; G12>=G15; G12>=G16; G12>=G17; G12>=G18; G12>=G19; G12>=G20; G12>=G21; G12>=G22; G12>=G23; G12>=G24; G12>=G25; G12>=G26; G12>=G27; G12>=G28);"Buy!!";"--")
I dont know if it matters but the ROI is a very small decimal percent. However I found that when 2 properties get close the "Buy!" symbol dissapears from all cells. I have compared all the formulas and found no issues.
I have attached the file to this post
The issue occurs when 1750 is but in cell B12. I have narrowed the issue to cells A6 and A10.
=IF(AND(G6>=G4; G6>=G5; G6>=G7; G6>=G8; G6>=G9; G6>=G10; G6>=G11; G6>=G12; G6>=G13; G6>=G14; G6>=G15; G6>=G16; G6>=G17; G6>=G18; G6>=G19; G6>=G20; G6>=G21; G6>=G22; G6>=G23; G6>=G24; G6>=G25; G6>=G26; G6>=G27; G6>=G28); "Buy!!"; "--")..............
I am trying to nest an ISERROR funtion into an IF AND statement.
Column B D E F
Cases Case Pack Reg Price VPR Price
1 14 2.25 0.00
1 14 1.75 2.00
When the value of F is zero, I want the formula to be B1*D1*E1, when the value of F is not zero, I want the formula to be F1*D1*B1. I can figure this part out. The problem is I have these values on a certain number of rows and I want a grand total at the bottom, but the rows that do not have values in them are giving me a #VALUE! error, which is messing up the grand total. I am not sure how to write the formula with the IF AND and ISERROR functions.
I have a column that lists names, and I need to count how many there are for each name, sounds easy enough use the following i think.
=SUMPRODUCT((A1:A10="Joe")
The trick is, I only want it to sum them if it's within the current month. I am entering something wrong because I get an error message.
Chart updates correctly when new pricees added.
But my IF function in column C leaves the annoying line to zero until prices are enter in column B.
Is there a function to do this or only VB code?
View 14 Replies View Relatedhow to return value from VBA User Defined Funtion
View 9 Replies View RelatedI have several worksheets where I input data, and I would like a 'stats' page as worksheet 1. Work sheet one is a list of names in cells A4:A28. column B,C,D,E,F, and G contain the results using Countif. How would I now get excel to look down a column, for example B, to find the highest number in that column and then use the name from that line but in column A.
View 3 Replies View RelatedI have the following formula: ...................
and excel is saying I used too many characters and to use the concatenate function to do so, but I have no idea how.
I wanted to return text rather than a '0' in the case that all the original IF statements were false, I threw another IF statement in there and said if the original is equal to '0', then return "-". If not, then run through the original again (I pasted the original again after the "-").
I know how to use array formulae to create a unique list, i.e.{=INDEX($G$1:$G$760,SMALL(IF(ROW($G$1:$G$760)=MATCH($G$1:$G$760,$G$1:$G$760,0),ROW($G$1:$G$760)),ROW()))}
however this is giving all the unique items from column G and I only want the unique items that have a non-zero value in column H as well. This would be the sumif of all instances that would have to be zero. I've tried to crack it and I've tried to search for solutions but so far no joy.
I am trying to pull cell values similar to a SUMIF function (SUMIF(range,criteria,sum_range)). For example, in A1 I use a data list created from data elsewhere on the spreadsheet. In the data I created elsewhere, there are 2 columns being used. The 1st column is the information that is being used to create the list and the second column contains specific values (number or text). In the dropdown menu I select an available value (text or number) . When I have selected that value I would like cell A2 to show what the cell directly to the right of it shows from the data I have elsewhere in the spreadsheet as mentioned. I have tried the SUMIF function however it seems to exclude certain values (number or text) and I am not sure what else to use.
View 9 Replies View RelatedI need to perform 2 SUMIF's on 2 columns of data to return a result and I'm not quite sure the best way of doing this. I'll give an example below.
I have 2 columns of data, both numeric and the SUMIF needs to say if H1:H100="10" and also if J1:J100="907". I can perform one or the other but not both.
I have many kitchens using the same recipes. I need to distill information down until I've got a summary of how much is being made. Uploaded is a condensed version of the point in the process I'm having difficulty with. This workbook will pull information from 8 other workbooks and give me excatly what everyone made on any weekday.
And from there, with the kind help of this forum, I figured out how to do a SUMIF based on the recipe number. And it summed up all instances of 'Recipe X' being used. However, it continues to SUMIF itself all the way down the page... which is good, because of how recipes are chosen for each kitchen. However, I only need to report one instance of each recipe.
In the uploaded example (and I apologize for the colorful sheet, but it helped me double check what I was working on.) ... I only need to report the PURPLE results elsewhere... the first instance of each SUMIF.
I am wanting to use these two formulas in one cell. Is there anyway to do this? If "AD3" is 0 I want this =SUM(X3:AC3) and then if cell "AD3" is greater than 0 I want to basically use this formula
=SUM(AH3,X3:AC3)-AD3.
Is there anyway to merge these two formula's?
I am trying to build a selection for a procedure to use.
View 2 Replies View RelatedI'm working on a sheet where by I need to reference multiple columns of information to calculate a total.
Such as (simplified example of my real issue):
__A__B__C
1 20 AP1 C30
2 25 AP1 C30
3 35 AP2 E10
4 50 AP3 E10
My requrement is to only add values in column A wich have corresponding column B="AP1" AND column C="C30"
I've tried the following and keep getting errors:
=SUMIF(AND(C1:C4,"C30"),(B1:B4,"AP1")),A1:A4
I'm trying to do this:
=SUMIF(B5:B12,OR("=D*","=?D*"),D5:D12)
It returns zero each time.
(BTW,
=SUMIF(B5:B12,"=D*",D5:D12)
and
=SUMIF(B5:B12,"=?D*",D5:D12)
both work just fine and return non zero sums.)
So my question is,
Where do I put the OR, or is there another way to do this?
I have a workbook which I am trying to clean up and make more efficient (in terms of formula calculating time).
In it are examples of array formula such as this one (which work correctly):
{=SUM(IF(Expected!$A7:$A894=5,Expected!$K7:$O894))/3}
From past readings here, I have heard that the array {SUM(IF(...} is slower in calculating than the SUMIF(...) equivalent.
As such i tried to convert is to:
=SUMIF(Expected!$A7:$A894,5,Expected!$K7:$O894)/3
This gives a different answer though. I thought for a single criteria they would be equivalent.
Q1: What am I doing incorrectly above?
Q2: Is there a more efficient version of the array formula I could use (SUMIF and otherwise), so I can have some options availible.
I got a column A containing a alpha-numeric data and want to sum up the numeric value of each cell which begins with "t" and have the sum divided by 486 (i.e. (120+230+25)/486). I tried the following formula but to no avail.
A
t120
t230
m45
m30
t25
My formular: sumif(mid(a1:a5,2,3,">0"))
I have worksheet of data. I have another worksheet that is used just for a summary. This data is mapped to a "Job number" (1123646, 1256974, etc.) The first two numbers determine what area it is referring to.
Each column represents a different amount (month to date cost, month to date profit, year to date cost, year to date proift, etc.) I need to summarize each column for each area and display the result on the other worksheet.
I can't use exact ranges like = sum(a9:a31) b/c that range will change each time the worksheet is used. I thought maybe using a loop, but then I got stuck and don't know where to go from here. Here is what I have so far.
Sub SumProfit()
Dim C As Range, sh1 As Object
Application. ScreenUpdating = False
Set sh1 = Sheets("JB-PRF")
Set C = Range("A9")
I don't want to abuse LOOPING or VBA for that matter, but I don't know of any other way to accomplish this seeing as how the ranges will not be the same each time. the shee that the data should be extracted to is named SUM-PRF
I am trying to sum the total of 10,000 lines in column B if column A is 0. I cannot get sumif to work. do I use a different formula?
View 6 Replies View RelatedI know this is a dumb question but I can't get a sumif to work in vba. I want the actual formula in the cell, not just the output value.
This is my most recent attempt:
VB: Range("C2").Formula = "=SUMIF(Z7:Z12000, >0,N7:N12000)"
I get Run-time error 1004, application defined or object defined error.
Why doesn't this work?
I have this from FDIBBINS working if data is on column D and E
=COUNTIF($E$2:$E$4,A2)
How would the same count function if there is a column between d and E
as attached ?
Column A has employee Numbers . ( May repeat , not necessarily specific no.of times )
Column B has date of Joining
Column C has effective date ( There is certain amount to be paid to that employee , from that date until it is revised to a new value )
Column D to - Column H has Months .(Jan-2013 to Jun 2013 ) with the amount to be paid as stated above.
What is the total amount to be paid for an employee considering the updated values .
As shown in the excel , coloured cells are to be summed up for an employee (ex:- Emp.No 1 , Emp. No 2 )
Emp. NoDate of JoiningEffective Date Jan-13Feb-13Mar-13Apr-13May-13Jun-13
11-Dec-12 1-Dec-12100110000400010003000 500
21-Jan-131-Jan-13102112100484012103630605
11-Dec-121-Apr-1300010003993666
32-Feb-131-Feb-13014641585614644392732
11-Dec-121-May-1300005315886
43-Jun-131-Jun-1300000974
[code].....
Here is the Formula.
=SUMIF(***!$F$6:$F$951,B16,***!$G$6:$G$951)
excel screen shot.PNG
This is the page it is referencing to.
PO screen shot.PNG
This is where the formula is. It is in "I16"
What I want to do is Take this and add in the multiplier from column "H" in the "***" page. I need to change the name of that tab, I am not trying to be foul. I just use that short for assembly. It looks bad, but usually, I'm the only one that sees it.
Basically, I want to take the material qnty and multiply it by the multiplier and put that in the box on the po page that accumulates the material.
I am writing the sumif function in F2 but it is not working correctly..
View 14 Replies View RelatedI am having a problem with a formula I think I should be able to get correct but not sure if I am able to do so. On the attached file I have a filter on the TIER's for "Is grater than or equal to 5". What I need is a SUMIF formula that will take into account the filters. This formula needs to separate out between "GER", "IRE" and "UK" in cells C37, C38 and C39.
I have a subtotal in cell C35 which gives me the subtotal of all countries but I'd like to be able to have the subtotal separated out between the 3 countries and also still have the ability to manipulate the data so I could select different TIER's or a range of TIER's and Cells C37 - 39 automatically update themselves.