Sumif Function involving dates and text - excel

I have a three columns which contain a range of dates, ie 6/15/2013, corresponding items ie. gravel, asphalt etc and corresponding tonnages. I need to be able to sum all of the tonnages of asphalt per month.
I have tried several sumif statements but they are all coming back with no value. Everything was going fine until I tried to add the sorting by month "if" statement.
Any help is appreciated.
Sample Data below
Column A | Column B | Column C
6/23/2013| Asphalt | 12
7/14/2013| Asphalt | 14
6/15/2013| Gravel | 15
8/15/2013| Gravel | 18
6/3/2013 | Asphalt | 14
thanks

If you have Excel 2007 or later try using SUMIFS, e.g. in F2
=SUMIFS(C:C,B:B,"Asphalt",A:A,">="&E2,A:A,"<"&EOMONTH(E2,0)+1)
where column A contains dates, B items and C tonnages....and E2 should contain the 1st of the month for which you want to sum. You can add more more dates in E3 down and then copy that formula down

Related

SUMIF and DATEDIF by row

I have a row of dates, with one date per column. Dates are in order from oldest to newest. I am trying to count only those where the difference is 14 days or greater. I need it to count by row
Date A | Date B | Date C | Date D | 2
So Date B - Date A = 13| Date C - Date B = 29| Date D - Date C = 15| 2
The formula should return 2, since the first was less than 14 days.
I've spend hours on various forums with no luck. I never post since I am usually able to figure my problems out by reading other's kind posts & suggestion. I appreciate whatever help comes my way.
You can do it with SUMPRODUCT:
=SUMPRODUCT(--(B1:D1-A1:C1>=14))
Note the offset but same size ranges.
If you use a helper row, you can combine simple subtraction with a COUNTIF():
So in A2, put =B1-A1 and drag right.
Then in E2: =COUNTIF(A2:D2,">=14")

Extracting all information(different) with same row name form a excel worksheet using formula

I have a excel workheet having a table with multiple rows having same name with different information in the corresponding columns. Now using a formula I want to extract this infomation into a new table? SOLUTION HAS TO BE USING AN EXCEL FOMULA ? NO FILTERS NO PIVOT TABLE OR VBA
I have tried vlookup. to search for multiple values. I dont want information from a single column but rather from all the columns. There could be thousands of columns with same and different values.
I have tried this formula : =INDEX(Worksheet!A2:AK350;KKLEINSTE(WENN((A5=Worksheet!A2:A350);VERGLEICH(ZEILE(Worksheet!A2:A350);ZEILE(Worksheet!A2:A350));"");1))
The table looks like this for example:
Place People Salary Status
japan | resident_1 | 564 | un-married
Delhi | resident_1 | 655 | un-married
china | resident_1 | 564 | un-married
japan | resident_2 | 748 | un-married
Now I want to extract a sub table from the above, like all the
infomation having PLACE name as "japan"
the reult should be this for each place in a different table:
japan | resident_1 | 564 | un-married
japan | resident_2 | 748 | un-married
Seems like a job for advanced filter, but you've already stipulated "no filters". If you're able to add two helper columns in your main table, maybe you can use the approach below.
This is my main_table worksheet (note the columns outlined in red, which have been added).
The formula in column E (starting from cell E2) is: =CONCAT(A2,"|",B2,"|",C2,"|",D2)
The formula in column F (starting from cell F2) is: =ROW()-ROW($F$2)+1
Drag/fill these formulas down to the last row in your main table.
This is my sub_table worksheet (note the cells outlined in green at the top, where you will eventually specify filter criteria).
The formula in column A (starting from cell A5) is: =ROW()-ROW($A$5)+1
The formula in column B (starting from cell B5) is: =IFERROR(SMALL(IF(ISNUMBER(SEARCH($B$2,main_table!$E$2:$E$10)),main_table!$F$2:$F$10,""),$A5),"")
The formula in columns C, D, E, F (starting from cell C5) is: =IF(ISNUMBER($B5),INDEX(main_table!$A$2:$D$10,$B5,COLUMNS($C5:C5)),"")
The formula in cell B2 is: =CONCAT(IF(ISBLANK($C$2),"*",$C$2),"|",IF(ISBLANK($D$2),"*",$D$2),"|",IF(ISBLANK($E$2),"*",$E$2),"|",IF(ISBLANK($F$2),"*",$F$2))
You should drag the formula down for the same number of rows that are in your main table.
I think newer/upcoming versions of Excel have a JOIN worksheet function which is more convenient/flexible than my usage of CONCAT above (so maybe use that if it's available to you).
Leaving the filter criteria blank should give you all rows. If you want partial matches, include wildcards in your input e.g. jap* or resident_*. If any of the values in your main table contain a |, you may want to use a different delimiter in the CONCAT formulas (otherwise you may get unexpected results/behaviour).
Once you're done, maybe you can use it like shown below:
See if this approach is any good for you (you will probably need to translate the formulas to your locale/region).

Excel FORECAST function from historical data in multiple row

A B C D E F ...
-------------------------------------------
1| QUARTER 1
-------------------------------------------
2|Week 1 2 3 4 5 ...
-------------------------------------------
3|SALES $500 $300 $100 $280 $600 ...
-------------------------------------------
4| QUARTER 2
-------------------------------------------
5|Week 14 15 16 17 18 ...
-------------------------------------------
6|SALES $200 $100 $300 ???
-------------------------------------------
I have a similar table that stores the Sales revenue data on a quarterly basis
My problem is that the FORECAST formula doesn't allow me select historical data from 2 rows
I have tried the below formula's:
=FORECAST(E6,(B3:N3,B6:N6),(B2:N2,B5:N5))
=FORECAST (E6,(B3,C3,D3,E3...B6,C6,D6),(B2,C2,D2,E2...B5,C5,D5))
None of the above worked. What am I doing wrong?
Secondly, is there way to use FORECAST.ETS or similar function in Excel 2013 via other means like vba or other formula?
Lastly, Is it possible to skip/consider Holidays period, where office is closed for over a month?
Following are the changes required in the data and the formulas.
(B3:N3,B6:N6) and (B2:N2,B5:N5) are not in one continuous row or column.
You need to change the way data is entered to B3 to AA3 and B2 to AA2, and then change the corresponding formula to (B3:AA3) and (B2:AA2).
Even if you use a Name for the range, instead of cell reference, it has to be one continuous range of Row or Column. Blank (and Text) values of Known_Xs and Known_Ys are ignored. However both X and Y ranges have to be equal in length.
Your attempt to use the formula using cell names instead of ranges also cannot work. It will work only if cell refences are replaced with values. After you test the formula, select the range, example B3:AA3 and click F9. The cell references will be replaced with numerical values, and the formula will still work.
I hope this will give you a better clarity of what you need to change to make your formula work properly.
Regards,
Vijaykumar Shetye,
Spreadsheet Excellence
Panaji, Goa, India

How to sum a row in Excel with lookup values from a column based lookup?

I have rows of values in columns AC to AU (but also some blanks)
I want to convert these values in a formula via a lookup and sum all the lookup values in a row.
For 1 cell I can use VLOOKUP(AC2,'Lookup_Table'!A2:B41,2) successfully
How do I sum the whole row of AC2 to AU2 with this kind of lookup?
Note the lookup is column oriented in a vertical lookup, the 'Lookup Table' is actually a worksheet.
This has stumped me for hours now!
| AC | AD | AE ..Ax... AU
Row 1 | 12 | 23 | 43 ..00... 67
'Lookup table' worksheet
A | B
12 | 4
23 | 2
43 | 3
67 | 5
The result should be 14 for the sample Row 1 data above
It is much easier to use an array formula (ctrl+shift+enter instead of just enter). Generally I don't like array formulas (because they are easy for the uneducated to break), but I think it will work the best in your situation apart from reformatting your sheet or using helper columns.
{=SUM(IF(AC2:AU2=Lookup_Table!A2:A41,Lookup_Table!B2:B41))}
which should have {} around the whole thing if you entered it correctly.
You need to use a combination of SUM and INDEX functions, where AB in Lookup_Table is your index column for the table, and A! is the value you wish to lookup:
=SUM(INDEX(Lookup_Table!$AC$1,MATCH(A1,Lookup_Table!$AB:$AB,0)):INDEX(Lookup_Table!$AU$1,MATCH(A1,Lookup_Table!$AB:$AB,0)))

Excel SUMIF column value matches

I would like to sum all values in column J when the value in column K matches. So, for example, I have the following:
COL J | COL K
25.00 | Now
45.00 | Aug 15
40.00 | Sep 10
70.00 | Now
14.00 | Aug 15
92.00 | Now
I'd like Excel to find all matching values in Column K and add up the values in corresponding rows of column J. For the example above it would sum 25.00, 70.00 and 92.00 which correspond with "Now" and then also add up 45.00 and 14.00 which correspond with Aug 15.
I know it can be done with formulas like this:
=SUMIF(K:K,"Now",J:J)
=SUMIF(K:K,"Aug 15",J:J)
However, I'd like to be more flexible and not have to have a separate formula for every different value in Column K. Is there a way to use a wildcard of some sort that can replace "Now" and "Aug 15" in the example above so that I could just have one formula that finds any matches in Column K and sums the corresponding values for those rows in Column J?
Thank you!
SUMIF accepts wildcards (e.g., this or this).
I tried adding another line to your data,
92.00 | Never
and then =SUMIF(K:K,"N*",J:J). It works great. If I understood what you were specifically aiming at, it would be =SUMIF(K:K,"*",J:J).
PS: I wouldn't know how it behaves when you have cells formatted as date, and you try to match according to what is displayed. That might involve locale issues.
You need to investigate Array Formulas also known as CSE formulas. http://www.mrexcel.com/articles/CSE-array-formulas-excel.php or http://office.microsoft.com/en-us/excel-help/guidelines-and-examples-of-array-formulas-HA010342564.aspx
=SUM(IF($K$1:$K$6=K1,$J$1:$J$6,0))
If you paste this formula into cell L1 (assuming your data is in K1:J6) and press Control-Shift-Enter to save it, it will calculate the sum of all the cells in Column J that have a matching Column K. Array Formulas are pretty powerful but they are pretty hard to debug.

Resources