sumifs

SUMIFS with multiple criteria variable

空扰寡人 提交于 2019-12-02 03:03:37
I just discovered here that I can use SUMIFS with multiple criterias, which is really cool. But there is any way to set a variable to the criterias? Example: instead of writting =SUM(SUMIFS(sum_range,criteria_range,{"red","blue"})) I would like to put the text "red" on the cell A1 and write: =SUM(SUMIFS(sum_range,criteria_range,{A1,"blue"})) Thank you If your range of values is A1:A2, try using that as the third (Criteria1) argument, and pressing CTRL + SHIFT + ENTER instead of just ENTER . =SUM(SUMIFS(sum_range,criteria_range,A1:A2)) This will produce an array formula and you should see

SUMIF contains one of elements in array (OR)

那年仲夏 提交于 2019-12-02 01:30:16
I have a list of payments where I would like to sum up the costs which description equals to one of the elements in my array. EMTE € 120,00 Bread € 35,24 Lidl € 0,89 Plus € 5,19 Aldi € 2,29 Jumbo € 4,70 So with an array of {"Lidl", "Aldi"} , It would give me the total of (2,29+0,89) 3,18. I tried Sum.If , but I don't seem how to use the or statement in it properly and combine it with an array kind of input. Wrap the SUMIF / SUMIFS function in a SUMPRODUCT function to provide an extra level of cyclic calculation. =SUMPRODUCT(SUMIFS(B:B, A:A, {"Lidl","Aldi"})) You could use a pivot table to get

Find a percentage based on multiple columns of criteria in R

南楼画角 提交于 2019-12-01 23:27:34
I have multiple columns and I would like to find the percentage of a one column in the other columns are the same. For example; ST cd variable 1 1 23432 1 1 2345 1 2 908890 1 2 350435 1 2 2343432 2 1 9999 2 1 23432 so what I'd like to do is: if ST and cd are the same, then find the percentage of variable for that row over all with the same ST and cd. So in the end it would look like: ST cd variable percentage 1 1 23432 90.90% 1 1 2345 9.10% 1 2 908890 25.30% 1 2 350435 9.48% 1 2 2343432 65.23% 2 1 9999 29.91% 2 1 23432 70.09% How can I do this in R? Thanks for all the help. You can create your

sum if greater than in r

…衆ロ難τιáo~ 提交于 2019-12-01 20:58:56
I have a dataframe (obs) with 145 rows and more than 1000 columns plus a numeric vector with 145 values (thr). I would like to derive another vector (sumifs) with 145 elements where each element is the sum of the values of obs[n,] >= thr[n]. I thought I could run a for loop where a single row sum is calculated more or less like: sumifs[n] <- if(obs[n,]>=thr[n],sum(obs[n,])) but I didn't manage to make it work for the single row either. I've been giving a look to other questions where it has been suggested to use aggregate or the plyr package but I didn't really find anything. A simplified

SUMIF dynamically change summing column

只谈情不闲聊 提交于 2019-12-01 00:21:49
I am using SUMIFS and want the sum_range dynamically to change according to the name I have of a column. I have a table with about 100 columns. Say one of these columns is Paid_BC_items . I want a formula that looks for which column Paid_BC_items is in and somehow insert that into the SUMIF here where the Sheet4!J:J part is. I have a few other criteria here too which are fixed so they don't need to be dynamic. =SUMIFS(Sheet4!J:J,Sheet4!$C:$C,Sheet2!$D$3,Sheet4!$E:$E, Sheet2!$C6, Sheet4!$G:$G, Sheet2!$D6) If for example I changed the column heading to something else I want the SUMIF then to

How to write a SQL query implementing Excel SUMIFS function

▼魔方 西西 提交于 2019-11-30 19:25:45
问题 I have a table like this: Date Sales Department Store 02/01/2012 4.09 Toys A 03/01/2012 5.90 Toys A 02/01/2012 6.64 Toys B 03/01/2012 4.71 Toys B 02/01/2012 16.72 Toys C 03/01/2012 1.37 Toys C 02/01/2012 13.22 Movies A 03/01/2012 18.06 Movies A 02/01/2012 5.97 Movies B 03/01/2012 16.71 Movies B 02/01/2012 15.38 Movies C 03/01/2012 19.75 Movies C And want a table like this, where only Store A and B are considered: Date Toys Movies 02/01/2012 10.73 19.19 03/01/2012 10.61 34.77 Here the SUMIFS

Excel SUMIFS checking if a column contains text

吃可爱长大的小学妹 提交于 2019-11-29 16:13:27
I have an excel document with data in a PivotTable that is displayed with several subcategories. I need to check if text anywhere in column A contains a particular word and then also check the text in column C to see if it contains a particular exact phrase. So far, I'd come up with =SUMIFS('tab1'!D5:D300, 'tab1'!A5:A300, "WORD", 'tab1'!C5:C300, "PHRASE") The issue I've run into is that the excel tab this formula is checking displays information like this and it will give me the result of "0" for anything but the first phrase (which I assume is because the first phrase shares a row with the

SUMPRODUCT vs SUMIFS

丶灬走出姿态 提交于 2019-11-29 12:37:47
问题 I'm trying to make an in-company guide to Excel (we're a small non-profit and sorely need some sort of baseline guide). However, I've gotten stuck trying to explain the differences between SUMPRODUCT and SUMIFS. My understanding is that SUMPRODUCT was used before Excel 2007 as a way to have multiple sumif criteria (among other things). Now that SUMIFS is available, is there any difference in the capacity of both formulas? I've looked around a bit and found that SUMIFS tends to be faster, but

Excel SUMIF between dates

☆樱花仙子☆ 提交于 2019-11-29 09:11:05
I have column A with date values formatted as mm/dd/yyyy . I am trying to sum the values of column B if A >=DATE(2012,1,1) AND =SUM(B:B) sums B properly, but if I try to use =SUMIF(B:B,A:A>=DATE(2012,1,1)) the value returned is 0.00 . I'm assuming this has something to do with using decimal for the sum and date type for the criteria. Is there a way to get around this? Thanks You haven't got your SUMIF in the correct order - it needs to be range, criteria, sum range. Try: =SUMIF(A:A,">="&DATE(2012,1,1),B:B) To SUMIFS between dates, use the following: =SUMIFS(B:B,A:A,">="&DATE(2012,1,1),A:A,"<"

Excel SUMIFS equivalent in R

末鹿安然 提交于 2019-11-29 04:37:28
I'm very very new to R and am looking at ways of recreating an Excel VBA macro and Excel worksheet functions such as SUMIFS. SUMIFS sums a column if the row has entries matching multiple conditions on its other columns. I have the below data frame and I want to compute a new column. The new column is the sum of Sample for all rows that overlap with the Start Date and EndDate range. For example on line 1 it would be 697 (the sum of the first 3 lines ). The criteria for the sum specifically: include Sample if EndDate >= StartDate[i] & StartDate <=EndDate[i] StartDate EndDate Sample *SUMIFS