I have a dynamic Spreadsheet with these columns.
Subject | ID | Status | Assigned To | Created By | Created On | Date Closed
I am trying to create a formula that can count:
Count all where status=Completed and Date is this year.
Count all records that were created today
I tried multiple formulas but I am not sure why its not working, I am not able to filter properly to get the correct records. Any help would be beneficial.
I tried =COUNTIFS(B:B, "Completed", H:H, ">=01/01/2018") But this did not filter the record.It still includes records from previous years.
I also tried two separate count if statements. Those those did not seem to work either.
Your formula seems fine. Just check and make sure the date format is correct. You can also add a separate column for year (you can use year function) and write =COUNTIFS(B:B, "Completed", I:I, 2018). (I guess your code doesn't run because Excel considers your given date as text and not a true date!
If you are sure that your H:H is a date format but not text, you may try to use the integer equivalent of 01/01/2018 in yor formula, which is 43101. So your formula would be:
=COUNTIFS(B:B, "Completed", H:H, ">=" & 43101)
Or you may write your limit date to a cell and may directly reference that cell in your formula:
=COUNTIFS(B:B, "Completed", H:H, ">=" & E7)
Related
I am trying to apply vllokup for a specific month of a specific year. My formula works for string lookup value but not works for date. here I attached my effort
First of all VLOOKUP() will not work in this case because VLOOKUP() always lookup values on first column of table then return value from corresponding row from specified column. So, you first column is strings and vlookup do not find dates on first column. Use Index/Match instead.
=INDEX(B3:B5,MATCH(D1,C3:C5,0))
You can also use FILTER() function.
=FILTER(B3:B5,C3:C5=D1)
Query() will also work-
=QUERY(B3:C,"select B where C= date '" & text(D1,"yyyy-mm-dd") & "'")
Vlookup works by searching columns to the left of the searched column. So you should modify your sheet to look like this (if possible) :
However, you should also take into account that the formatting of your cells could be misleading. If your D4cell has the value 1/Jan/2022 and your C6 cell has the value of 2/Jan/2022, then both of them will show as Jan 2022, but your formula will still return N/A because the real values of the cells are different.
I have two columns in excel, one with a date and one with a rating 'low, medium, high'.
I'm trying to write a formula to put in a third column that checks:
If A2 = Low and B2 (date) is older than 12 months from today(), output Overdue
If A2 = Medium and B2 (date) is older than 6 months from today(), output Overdue
If A2 = High and B2 (date) is older than 3 months from today(), output Overdue
If these parameters aren't met, output "Current".
This is what I have so far but I'm well aware its not right :)
Could someone please point me in the right direction?
Thanks,
=IF(AND(A2="Low",LOOKUP(DATEDIF(B2,TODAY(),"m"),{0,3,6,12},{"Current", "Current" "Current","Overdue"}),(A2="Medium",LOOKUP(DATEDIF(B2,TODAY(),"m"),{0,3,6,12},{"Current","Current","Overdue","Overdue"}),(A2="High",LOOKUP(DATEDIF(B2,TODAY(),"m"),{0,3,6,12},{"Current","Overdue","Overdue","Overdue"})
If you can use the excel 365 then I’d suggest creating an excel lambda function:
=LAMBDA(level, date, LET(months, IFS(level="Low",12,level="Medium",6,level="High",3,TRUE,0), IF(date < EDATE(Today(), -months),"Overdue", "Current")))
so to break it down, this is a custom function that expects 2 parameters :
level is the value/reference that has low/medium/high. this is used to determine the number of months for the threshold - 12/6/3 respectively and 0 for anything else though you could change that as needed.
date is the date to check if its beyond the threshold. this is compared against today minus the number of months calculated from the level. if this is before that date then this function will return “Overdue”. otherwise “Current”.
You would create a workbook level named reference with this function as the value.
Here I named it IsCurrent. Then you just use that function where you want the output. e.g.
What I would suggest is to "outsource" the settings for the overdue months.
This is a good habit, as everyone looking at the table can see those settings and propably adjust them - without going into the formula.
And it is possible to use these settings in another formula :-)
If you use Excel 365 you can make the formula more readable/understandable with the LET-Formula.
=LET( OverdueMonthsForRating, IFNA(INDEX(configOverdue[Overdue months],MATCH([#Rating],configOverdue[Rating],0)),0), OverdueDate,IF(OverdueMonthsForRating>0, EDATE([#Date],OverdueMonthsForRating),TODAY()), IF(OverdueDate<TODAY(),"overdue","current") )
OverdueMonthsForRating is using a classic INDEX/MATCH to retrieve the number of months according to the Rating. In case Rating is not found 0 is returned
OverdueDate calculates - using EDATE - the overdue date based on the ratings date and OverdueMonthsForRating. In case Rating is not found TODAY is returned
Finally this date is evaluated against TODAY and the status is returned.
Classic Excel formula w/o LET:
=IF(EDATE([#Date],IFNA(INDEX(configOverdue[Overdue months],MATCH([#Rating],configOverdue[Rating],0)),TODAY()))<TODAY(),"overdue","current")
I am trying to calculate values within a specific date range. The data I want to split between each month and the values: Successful, Incomplete and Failed.
I've tried pivot tables with this data but it doesn't work for me, also lacking pivot table excel experience. Formulas I'm more comfortable with.
I am using the following statement to at least get the total number of a value I add into it;
=COUNTIF('Jan 19'!$C$2:$C$1159,"Value")
Ex. If I put into the value "Successful" I get the total number of successful records.
I am looking into having a formula that I can input a specific month/date range (Jan, Feb, etc) and a value to get a count.
Ex. =Formula ((RangeOfData, "Value") AND (RangeOfData, (FromDate, ToDate))
I expect to the get the total number of a value(s) within a specific date range. If there isn't any data then the results would be blank or 0.
I'd use the formula COUNTIFS() as #cybernetic.nomad pointed in the comments so you can put more conditions on the COUNT:
=+COUNTIFS('Jan 19'!$B$2:$B$1159,">="&F3,'Jan 19'!$B$2:$B$1159,"<"&G3,'Jan 19'!$C$2:$C$1159,H3)
In the formula above I guessed the dates are in the COLUMN B, if not, you need to change it in the formula above.
To do that we should put the range we want to look at in a couple of cells where you would put the date range, in the example above:
F3 is the start date (if you want February of this year should be 1/2/2019).
G3 is the final date (if you want February of this year should be 1/3/2019).
H3 is where you can write "value", "successful" or any other string you are trying to count.
Excel formula required as per the following conditions:
Conditions:
After Date after 31/07/2017
Before Date after 12/10/2016 & Before 01/08/2017
Old Date after 12/10/2015 & Before 12/10/2016
Very Old Date Before 12/10/2015
Output as follows
Date Status
12-03-2014 Very Old
10-03-2015 Very Old
11-02-2016 Old
05-05-2016 Old
22-12-2016 Before
25-01-2017 Before
28-02-2017 Before
20-03-2017 Before
19-06-2017 Before
20-07-2017 Before
21-07-2017 Before
10-08-2017 After
25-08-2017 After
29-08-2017 After
01-09-2017 After
08-09-2017 After
Please help
CSGanesh
Create a table with the start dates and the expected outcome:
Then use VLOOKUP()
=VLOOKUP(D2,A:B,2,TRUE)
If you do not want to use a table but want hard-coded formula then:
=CHOOSE(MATCH(D2,{0,42289,42655,42947}),"Very Old","Old","Before","After")
{0,42289,42655,42947} are the dates in general format and can be replaced with the actual dates in quotes; {"1/0/1900","12/10/2015",...}
I would use a nested if statment here is a link:
https://exceljet.net/formula/nested-if-function-example
here are the first two conditions, excel can interpret time intervals so lock a cell with the conditions and then drag the formula. Remember to verify that the cell is indeed a date.
IF(date<12/10/15,"Very old",IF(AND(D6>12/10/15,date<12/10/16),"old",0))
I have an accounting spreadsheet where I am trying to create an analysis area which populates from the 12 month Actuals data so that when I enter a month, the function (in this case a SUMIF) will update the formula based on the specific column which contains the monthly data.
For example:
Cell O2 = the user input Month, for example: APR
Here is what the data looks like:
Product Department ACTUALS-APR ACTUALS-MAY ACTUALS-JUN …..
I have a Lookup table called: “MonthActuals” which looks as follows:
Month Column
JAN F
FEB G
MAR H
APR I
Etc…..
I have hard coded the other criteria to look up the actual amount, which are the Product and Department. So, the SUMIFS looks at the hard-coded Product and Department, but needs to look up the column for the month that the user wants the figures.
Here is my formula that works correctly WITHOUT using a VLOOKUP ( I hard-coded the month):
=SUMIFS(Sheet2!$F$8:$F$328,Sheet2!$B$8:$B$328," Total Glass Purchases ",Sheet2!$C$8:$C$328,"Scrap")
Here is my VLOOKUP which works correctly:
=VLOOKUP(E1,MonthActuals,2,FALSE)
HOWEVER, when I replace the “F” column reference in the formula with a VLOOKUP formula, I get a #value error message.
Here is the formula I used when I tried to combine the VLOOKUP with the SUMIFS.
'SUMIFS(VLOOKUP(O1,MONTHACTUALS,2,FALSE)&”8:”&VLOOKUP(O1,MONTHACTUALS,2,FALSE)&“328”,Sheet2!$B$8:$B$328,"Total Glass Purchases",Sheet2!$C$8:$C$328,"Scrap")
I don't want to use any VBA, but only use functions to do these calculations.
First be careful of ” they are not recognized by Excel, make sure they are all "
Next you will need to use INDIRECT()
SUMIFS(INDIRECT("Sheet2!" & VLOOKUP(O1,MONTHACTUALS,2,FALSE) & "8:" & VLOOKUP(O1,MONTHACTUALS,2,FALSE) & "328"),Sheet2!$B$8:$B$328,"Total Glass Purchases",Sheet2!$C$8:$C$328,"Scrap")