Excel SUMIFS formula on using operator inside criteria - excel-formula

SUMIFS(C1:C5,A1:A5-B1:B5,">5")
Is the above formula workable in excel?
Column A and Column B contain dates
Column C contains quantity.
What I need is When Column A minus Column B greater than 5 then sum all the quantity.
I understand this is able to do with creating a new column to get the difference in date first then use the computed value inside SUMIFS formula.
However, I really try to avoid adding an extra column.
Thank you

You can use the following formula:
=SUMPRODUCT(IF((A1:A5-B1:B5)>5,C1:C5))
this is an array formula, so press ctrl+shift+enter to calculate the formula.
Hope this works for you.

Related

Conditional large() using array in Excel

I'm using an array formula to calculate the second-largest value in each of Columns B-Z, conditional on the values being with a certain date range in Column A. Cells J2 and J3 contain the date ranges for IF function.
The formula I'm using is as follows:
{=LARGE(IF(($A$4:$A$4054>=$J$2)*($A$4:$A$4054<=$J$3),B4:B4054),2))}
In the majority of cases, the formula works perfectly but occasionally it is throwing up "0" as the answer - even though there's no zeroes in column D.
Is there an error with the formula? Or, alternatively, is there another formula I can use to achieve the same outcome?
Thanks in advance! :)

Sum the results of looking up multiple reference values

I am seeking a formula to replace my current method of adding another vlookup to my formula string each time another week passes (the current formulas in the cells in column D). i.e - I would like it to look through my header row (Row 2) for the referenced weeks and find each one of them in my lookup table (FTE_Lookup) to sum all of the corresponding possible hours for those weeks. I read a couple threads on Sumproduct for multiple vlookups, but it doesn't quite match my situation. Below is a a link to my dummied-down spreadsheet for an example. The data in Row 2; Column D; and the FTE_Lookup table are of interest to this problem:
https://drive.google.com/a/vt.edu/file/d/0B7LOhGW3xbKgbGUxS2x1anNfV00/view?usp=sharing
Thank you in advance.
You will need to split the lookup named range to its two columns. I used FTE_Lookup_1 for the date column and FTE_Lookup_2 for the return value column
Then use this array formula:
=E4/SUM(IF((MOD(COLUMN($E$2:$FG$2)-5,3)=2)*($E$2:$FG$2<>""),LOOKUP($E$2:$FG$2,FTE_Lookup_1,FTE_Lookup_2)))
being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting Edit mode. If done correctly then excel will put {} around the formula.

Is there a formula that will paste the result of a separate formula as a value?

Ex.
column A is a formula that outputs an 8 digit ID from a prior delimited calculation. I want to vlookup that ID to a separate set of data, but it is not finding the ID when the lookup value is part of a formula.
Is there a way to paste the formula result as a value in column b?
I have a list of 3000+ IDs, so using the F2, F9 trick won't work, since I would have to do that cell by cell.
Would prefer not to use VBA, but if that is the only way, can someone help simplify that process (new to using VBA)
If you have data in column A based on a left function of a bunch of numbers, and just want that result in column B, all you have to do is put:
=Value(ColRow)
in Column B. Then you can look up the value in Column B via VLookUp.
I am an avid Excel user and personally tested this solution. Though it appears #Scott beat me to it in the comment section.

Excel Conditional summation of rows

Hi all, I have a problem with a formula with SUMIFS and INDIRECT.
I want to sum up the lines in the D column that does not have the "AL" in the B column.
The number of lines between the sum of the row where the formula is and D6 will increase and vary.
I get the error #VALUE!
The formula is:
=SUMIFS(D6:INDIRECT("R[-1]C";0);B6:INDIRECT("R[-1]C";0);"<>AL")
examples of my excel worksheet layout
The line above having the formula =SUM(D6:INDIRECT("R[-1]C",0)) works great
I think that the formula should work but it doesn't.
Anyone who can figure out what is wrong with the formula?
Thanks!
/martin
In the SUMIFS function, the criteria_range needs to be in a single column. In the INDIRECT function you are using an absolute start column with a relative end column which results in multiple columns. Need to use an absolute end column. For example, change...
=SUMIFS(D6:INDIRECT("R[-1]C";0);B6:INDIRECT("R[-1]C";0);"<>AL")
to...
=SUMIFS(D6:INDIRECT("R[-1]C";0);B6:INDIRECT("R[-1]C2";0);"<>AL")

Excel: Calculate the frequency of a particular month in a column of date cells

I have a column with dates of events. ( let's say: A1:A100 )
Now I want to use a formula to find or display the number of events that occurred in January 2013.
Any ideas ?
What you need is an array formula, sometimes called "CSE" formulas because of the way you have to enter them:
Pick your destination cell and select it.
Then, in the formula bar, enter:
=SUM(IF((A1:A100>=DATEVALUE("1/1/2013"))*(A1:A100<=DATEVALUE("31/1/2013")),1,0))
And instead of [enter], press [ctrl]+[shift]+[enter]
I really don't understand why MS make you do the CSE thing- surely it's clear from the format that it's an array formula?
How about using Countifs to find records between a start and end date? You can either type the dates or point it to two cells containing the dates. Not sure which version of Excel you are using, but CountIfs is not supported in 2003 but beyond.
=COUNTIFS(A2:A100,">="&C2,A2:A100,"<="&C3)
or
=COUNTIFS(A2:A100,">=1/1/2013",A2:A100,"<=31/1/2013")
Use the FREQUENCY formula together with an auxiliary MONTH function:
Enter the number 1-12 in your results table (e.g. in D1:D12)
Select the the twelve adjacent cells (in the example it would be E1:E12) and enter =FREQUENCY(MONTH(A1:A1000),D1:D12) - enter the formula as array formula (i.e. press Ctrl-Shift-Enter instead of Enter)
In case you want to also separate by years, you need to modify your keys in column D and your formula to derive the key, e.g. instead of MONTH(A1:A1000) you could use MONTH(A1:A1000)&"-"&YEAR(A1:A1000) - or (if purely used in an one Locale environment TEXT(A1:A1000,"MM-YY").
A couple of ideas:
Use the SUMPRODUCT formula to summarize by month. See example: http://www.contextures.com/xlFunctions04.html#SumProduct
Use a Pivot table:
Add a column B =month(a1). Fill down.
Add a column C of all 1s.
Give A, B, C header names: Date, Month, Count.
Insert a Pivot table based on A,B,C. Now you can easily Sum by Month.
A formula (if you know exactly which month you are looking for):
Perhaps do a fill down in column B with a formula like this:
=if(and(month(a1)=1,year(a1)=2013),1,0), then sum() column B?
Use Consolidate functionality. Take a look at: http://www.techrepublic.com/blog/window-on-windows/use-consolidate-to-summarize-excel-data-without-sorting/6521

Resources