I have 2 tables. In first table I have project name and the cost for each project. The project names always start with data (yyyymmdd) for instance 20171201_Project1, 20171202_Project_2 etc. In second table I have dates and Summary of language 1
What I would like to do is to sum up all projects in Sheet2 between 2 dates so if I have done 7 projects between 20171201 and 20171211 I would like to have a formula that will sum them up.
I am currently using this formula:
=SUMIFS(Sheet1!F:F,Sheet1!A:A,">20171201*",Sheet1!A:A,"<20171211*")
However, I always have to put the dates manually. What I want to do instead is to use dates from column A in Sheet2 to indicate the range of dates. You can download the Excel file from here. I pout there new formula that doesn't work as well.
I have tried to use this formula but it doesn't show me correct value.
=SUMIFS(Sheet1!F:F,Sheet1!A:A,">=DATE(LEFT(A2,4),MID(A2,5,2),RIGHT(A2,2))*",Sheet1!A:A,"<=DATE(LEFT(A3,4),MID(A3,5,2),RIGHT(A3,2))*")
Regards,
Adrian
If I understand what you want, SUMPRODUCT may be a better fit.
Something like:
=SUMPRODUCT((LEFT(projCosts[Project Name],8)>=TEXT(A2,"yyyymmdd"))*(LEFT(projCosts[Project Name],8)<TEXT(A3,"yyyymmdd"))*projCosts[Cost])
Where the dates of interest are in A2 and A3 (in this example). Note that, depending on the precise date range you want, you may need to change the equality operators (<,>=) to include/exclude the equal sign.
Related
I am trying to summarise data I have in a table into months Jan,Feb,Mar etc, and need to separate the counts of various strings (such as HE(Technical)).
Some context: column "B" of my Data sheet are dates (not necessarily in chronological order), column "O" are keywords/strings.
I want to sort all instances of a particular string by the month based on the dates inputted in column "B".
May I know how I would go about this?
My current formula (in title) only returns zeroes.
Instead of working with an =IF(...,CountIf()) construction, you might try to work with a =CountIfS() formula (the IfS gives the opportunity to combine criteria.
For example, I have tried the following formula and the result was quite promising:
=COUNTIFS(B1:B3,2,O1:O3,"*HE*")
Good luck
I have a Simple spreadsheet with 2 rows:
ActualJAN | BudgetJAN | ActualFEB | BudgetFEB | ActualMAR | BudgetMAR ....
100 200 300 400 500 600 ....
I'd like to sum ONLY the Budget columns up to the current month (Month(Today()).
Same for the Actual columns.
So if we're currently in February,
Budget to date would be: 600=200+400
Actual to date would be: 400=100+300
I just can't seem to get there, at least simply and elegantly.
This is a non array formula that performs array like operations. As such large range references should be avoided or you will experience a slow down or potential crash of your system. For a small defined range works great so long as the formula is not repeated too many times either.
Additionally TODAY() is a volitile function which means the formula will recalculate whenever anything in the spreadsheet changes, not just when something related to the formula changes.
This formula is generalized a bit so your data can be located anywhere on your sheet and does not require rearrangement of your data.
To get your actual sum use the following:
=SUMPRODUCT($C$4:$H$4*(COLUMN($C$4:$H$4)-COLUMN($C$4)+1<=MONTH(TODAY())*2)*(LEFT($C$3:$H$3)="A"))
To get your Budget sum use the following:
=SUMPRODUCT($C$4:$H$4*(COLUMN($C$4:$H$4)-COLUMN($C$4)+1<=MONTH(TODAY())*2)*(LEFT($C$3:$H$3)="B"))
Change C4:H4 to suit your number range. ChangeC3:H3 to suit your column title range. Change C4 to be the first cell of your number range.
Caveat: Assumes maximum 12 months starting at January
Proof of concept:
I would recommend structuring your data differently. It would be an easier task if you arrayed everything vertically and divided your data into three columns. The first would be Category, which would be populated with either "Budget" or "Actual." The next column would be Month. After that, of course, you have the Value column. Then, use a basic SUMIF, like "=SUMIF(A1:A6,"Budget",C1:C6)." A1:A6 is the range Excel will scan for the desired variable. In this case, that variable is "Budget." Then, C1:C6 is the value that corresponds to a "Budget" month. That formula will give you the answer you want as long as you expand the SUMIF formula to include the full range of values, e.g., "SUMIF(A1:A317,"Budget",C1:C317)."
So I think I understand what you're trying to do, I cannot make the entire formula without the rest of the spreadsheet but this is working currently:
For the Actual:
=IF(MONTH(TODAY())=1,A2,IF(MONTH(TODAY())=2,A2+C2,IF(MONTH(TODAY())=3,A2+C2+E2,"")))
For the Budget:
=IF(MONTH(TODAY())=1,B2,IF(MONTH(TODAY())=2,B2+D2,IF(MONTH(TODAY())=3,B2+D2+F2,"")))
Here is the spreadsheet I created to test:
If you give me the rest of the data I can complete the formula, basically all you would need to do is add more months to the formula and change the amounts it adds.
I am sure there is probably a more efficient way to accomplish this but this way works.
I suggest a hidden row to control your dates. Say, January is in column C, enter [C1] =1, [D1] =C1, [E1] =C1+1, [F1] =E1. Select E1:F1 and copy to the right until December. Hide row 1.
In row 2 use these two formulas.
[C2] ="Actual" & UPPER(TEXT("1/" & C$1,"mmm"))
[D2] ="Budget" & UPPER(TEXT("1/" & D$1,"mmm"))
Select C2:D2 and copy to the right until December. This exercise isn't required because the resulting display is exactly what you already have. But producing this result with the help of formulas ensures freedom from error, and it is faster. As an added bonus you get a visual check of what's in the hidden row.
Now you can use this formula to extract totals from row 3 where you have your values.
=SUMIFS($C3:$Z3,$C$2:$Z$2,"Budget*",$C$1:$Z$1,"<="&MONTH(TODAY()))
Change "Budget" to "Actual" and the same formula will extract the actual amounts.
I have two lists, the first is a set of users. The second list contains different encounter dates for these users.
I need to identify the date that is within 10 days of the "Renew Date" [Column C], but not before. With Member 1 this would be row 3 1/8/2017. With Member 2 this would be row 6, 1/21/2017.
Now using a VLOOKUP which the user before me who managed this spreadsheet obviously isn't viable as it's simply going to pickup the first date that has a matching Member ID. Is there a way to do this in Excel at all?
I have included a link to a sample file and a screenshoit of the sample data.
https://drive.google.com/file/d/0B5kjsJZFrUgFcUFTNFBzQzN4cm8/view?usp=sharing
To avoid the slowness and complexities of array formulas, you can try with SUMIFS but the problem is that if you have more than one match, it will add them, not return the first match. The sum will look like an aberration. Will work however if you are guaranateed that you have only one match in the data.
An alternative is also to use AVERAGEIFS, which, in case of multiple matches, will give you their average and it will look like a valid date and a good result. Enter this formula in D2 and fill down the column:
D2:
=AVERAGEIFS(G:G,F:F,A2,G:G,">="&C2,G:G,"<="&C2+10)
and don't forget to format column D as Date.
Try this
=SUMPRODUCT($G$2:$G$7,--($F$2:$F$7=A2),--($G$2:$G$7<=C2+10),--($G$2:$G$7>C2))
Format the result as date. See screenshot (my system uses DMY order)
Don't use whole column references with this formula. It will slow down the workbook.
I am looking for a way to count how many companies are in Column C on the specific dates of column A. Can one formula be applied to the count between all of dates?
I have tried looking up and using =CountBlanks and I do not want to have to manually select the cell ranges between the dates.
Ultimately I am also trying to put this data into a table so I can see on Feb 16 = 3 Companies, Feb 19 = 5. I can not use a VBA script as some users have macros blocked.
Please look at image for example
Example Image
Try this formula:
=COUNTA(INDEX($C$2:$C$21,MATCH($E2,$A$2:$A$21,0)):INDEX($C$2:$C$21,MIN(IFERROR(MATCH(TRUE,INDEX($A$2:$A$21>$E2,0),0),9999999),MATCH(TRUE,INDEX($C$2:$C$21="",0),0))-1))
Change the 21s in the formula to at least the extent of your data +1, It can be more, Full column references will not work due to the Word "Date" in the first row.
DATEDIF( start_date, end_date, interval )
you didnt even bother to google this, right?
edit: there should be enough common place stuff like isblank to accommodate the lack of values. If youre trying to find the values between A & C then you can easily adjust your formula accordingly.
I am trying to create spreadsheet to use in a small retail shop.
I have a workbook which contains expenses figures on a sheet and income figure on another sheet.
We can say that the common ground between the both sheets are the month.
I would like to write a function, which will only select those expenses of a specified month.
Something like -
=SUM(IF( Table4[Month]="January", Table4[Amount]))
// I want the sum of all expenses of a given table for only
// those months which are january etc.
I tried using the above, but it failed.
Actually a more refined solution is use the build-in function sumif, this function does exactly what you need, will only sum those expenses of a specified month.
example
=SUMIF(A2:A100,"=January",B2:B100)
This should work, but there is a little trick. After you enter the formula, you need to hold down Ctrl+Shift while you press Enter. When you do, you'll see that the formula bar has curly-braces around your formula. This is called an array formula.
For example, if the Months are in cells A2:A100 and the amounts are in cells B2:B100, your formula would look like {=SUM(If(A2:A100="January",B2:B100))}. You don't actually type the curly-braces though.
You could also do something like =SUM((A2:A100="January")*B2:B100). You'd still need to use the trick to get it to work correctly.
SUMIF didn't worked for me, had to use SUMIFS.
=SUMIFS(TableAmount,TableMonth,"January")
TableAmount is the table to sum the values, TableMonth the table where we search the condition and January, of course, the condition to meet.
Hope this can help someone!