I have a spreadsheet that records a timeline of information for different documents, specifically: when I send it, when I respond to it and when I need to finalise it.
In column J, I input the date I have sent the document given as a short date.
Column K, then automatically adds 15 days to J - giving me my response date.
=IF(J4<>"",SUM(J4+15),"")
Column L is my final date for when I've finished with the document.
What I'm struggling to create, is a conditional formatting formula for column K that reads the cells in column J - adds 15 days and highlights all the dates beyond the 15 days; that part is pretty simple. However, I would also like it to read the cells (in the same row) under column L - and if that cell is not blank/it has a date, then do not highlight column K. Meaning if I have finished with that document, I don't want it to run a formula to remind me to follow it up!
Below is a visual example:
So in the cell J3 reads the 27th November, add 15 days brings us to the 12th December which is before today's date (the 15th) and because there's nothing in L3 - I would like it to mark K3 as red.
Alternatively, in J4 is the 28th November, therefore it's the 13th December in K4 - however, because there's a date in L4 I do not want it to flag K4 in red.
Thank you, I appreciate the help!!
In order to highlight the values in column K if the date is passed and if column L contains a blank, you can use the following formula for your conditional formatting:
=AND(K3<TODAY(),ISBLANK(L3))
If you already have a formula for your conditional formatting, simply replace it. If not, you add the formula the following way:
Select K3 to K8
Home > Styles > Conditional formatting > New Rule > Use a formula to determine which cells to format.
Type in the formula above. It will automatically apply to the selected range.
Be aware that TODAY() is a volatile function which might slow down your workbook if you use it extensively.
Related
I'm building a yearly shift roster and I'm trying to figure out how to apply the conditional formatting to show where the weekends are. Figuring out how to define the weekend is easy, the problem here is getting the conditional formatting to cooperate with that rule.
Here's how I have my table set up for anyone trying to replicate this:
Row 1 - =LEFT(TEXT(row 2,"aaa"),1) this displays the single letter day of the week based on the date in row 2
Row 2 - The date, formatted to DD. A2 starts with 1/1/2016, B2 is =A2+1 and that is repeated all the way to column NB (=NA+1)
The conditional formatting formula I'm using is =WEEKDAY($A$2,2)>5, applied to $A$1:$A$15. Now this works great for column A, but when trying to copy it over to column B the rule is still referencing column A (however it will apply it to column B). What I'm struggling to figure out is how to get the conditional formatting rule to look at all 365 columns and then apply the conditional formatting to that single column and not the entire range. The end result here would be that the weekdays have no fill applied while the weekends are shaded.
The solution to this is to use =WEEKDAY(INDIRECT(ADDRESS(2,COLUMN())),2)>5.
Here's what's going on in each part, starting inside and working out:
COLUMN() returns the column number of the current cell (A=1, B=2, C=3, etc...), so for the sake of this example let's say you had cell A2 selected, COLUMN() will then return 1.
ADDRESS(2,1) returns a TEXT string of the absolute cell reference ("$A$2"), in this case locked to row 2.
INDIRECT("$A$2") converts the text string into the A2 cell reference.
WEEKDAY($A$2,2) evaluates the date in cell A2 (1/1/2016) and returns a numerical value based on what date of the week it is. The 2 argument sets the week as Monday (1) through Sunday (7). In this example WEEKDAY() will return a value of 5 (Friday).
I am trying to use some logic in a spreadsheet without any macros.
First I have a sinle cell that gives the date and time. I then used the custom format on that cell to just show the "h". So only hour numbers 1 through 24 appear in this cell. (e.g. at 3:20 p.m. I get 15 in the cell). (Cell # A:1)
=now()
Second, I have a separate single column with 24 rows numbered 1-24 (Cell #'s B1:B24)
I have a third column that has logic that states "Night" shift" for numbers 23 & 0-6; "Day Shift" for numbers 7-14; and "Mid Shift" for numbers 15-22) (Cell #'s C1:C24)
=if($A$1=B1,"Night Shift","")
However, the third columns all appear blank even tough one should appear. I tried changing A1 using text(A1,"#") but I get the serial number. Is there an easy way to dynamically have a value in column C show what shift based off the hour of the day in cell A1. Column D simply concatenates all 24 cells since there will only be one number ever. (Cell # D1). Thanks for any help.
You could use a LOOKUP formula to return the shift based on a time/date value in A1, e.g.
=LOOKUP(HOUR(A1),{0,7,15,23;"Night","Day","Mid","Night"})&" Shift"
Changing the format of the cell containing the date and time does nothing to the actual contents of the cell. It will still contain a value such as 43706.75 (number of days and fractions of days since 1/1/1900).
If what you want to do is determine the shift for the date/time in A1, you could use a formula like:
=IF(AND(HOUR(A1)>=7,HOUR(A1)<15),"Day Shift",IF(AND(HOUR(A1)>=15,HOUR(A1)<23),"Mid Shift","Night Shift"))
And similar logic if you need to apply different multipliers for the salary.
If you need something else, be more specific.
By doing =now() without any formatting you get the Date and the Time. Then in cell A2 do
=(A1-INT(A1))*24
Then in cell A3 do
=INT(A2)
This gives you the hour number extracted from a date format so a comparison can be made in column C against the numbers in column B. Thanks.
I am creating a tracker in Excel for response time for a business partner to act on a task after the assistant assigns them the task. If the business partner has not responded in greater than 7 days from the day they were given the assignment (K2), I would like the cell L2 to turn red. Which would indicate to the assistant that she needs to harp on the business partner to get their job done.
To sum up, if K2 = 02/07/14 then the business partner must respond by 02/14/14, but if they do not, then the cell must be red. It would be something like "If today's date is > K2 + 7 days, then highlight cell red." This is if there is a date entered into K2 (mm/dd/yy).
Additionally, I would want the cell to highlight green if the date entered in L2 is within 7 days of the date entered in K2. So that if/then statement would read, "If date entered in L2 is < or = K2, then highlight cell green."
Not certain what you want but please try:
=AND(L1<>"",K1-L1>7)
=AND(K1<>"",K1+7<TODAY())
It may do the opposite of what you want, but that should be easy to fix it you have some data for testing.
In Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true: with green for the first formula above and red for the last. May be applied to the whole of ColumnL.
I am creating a spreadsheet with all my data on one sheet and metrics on the other.
On sheet 1 in cells A2:A50 I have the dates in this format (4/5/13). On sheet 2 in cell E5 I have April and I want it to total the number of PO's created in F5.
How can I do this?
I have tried using
=COUNTIF('2013'!$A$2:$A$50,'2013 Metrics'!E5).
I have a feeling that since my range is in 4/5/13 format and my criteria is April that won't work.
I was able to use this formula for total spend by month:
=SUM(IF(MONTH('2013'!$A$2:$A$19)=4,'2013'!$D$2:$D$19,0))
but not luck with how many PO's by month.
Use a pivot table. You can manually refresh a pivot table's data source by right-clicking on it and clicking refresh. Otherwise you can set up a worksheet_change macro - or just a refresh button. Pivot Table tutorial is here: http://chandoo.org/wp/2009/08/19/excel-pivot-tables-tutorial/
1) Create a Month column from your Date column (e.g. =TEXT(B2,"MMM") )
2) Create a Year column from your Date column (e.g. =TEXT(B2,"YYYY") )
3) Add a Count column, with "1" for each value
4) Create a Pivot table with the fields, Count, Month and Year
5) Drag the Year and Month fields into Row Labels. Ensure that Year is above month so your Pivot table first groups by year, then by month
6) Drag the Count field into Values to create a Count of Count
There are better tutorials I'm sure just google/bing "pivot table tutorial".
For anyone finding this post through Google (as I did) here's the correct formula for cell F5 in the above example:
=SUMPRODUCT((MONTH(Sheet1!$A$1:$A$50)=MONTH(DATEVALUE(E5&" 1")))*(Sheet1!$A$1:$A$50<>""))
Formula assumes a list of dates in Sheet1!A1:A50 and a month name or abbr ("April" or "Apr") in cell E5.
Make column B in sheet1 the dates but where the day of the month is always the first day of the month, e.g. in B2 put =DATE(YEAR(A2),MONTH(A2),1). Then make E5 on sheet 2 contain the first date of the month you need, e.g. Date(2013,4,1). After that, putting in F5 COUNTIF(Sheet1!B2:B50, E5) will give you the count for the month specified in E5.
I would add another column on the data sheet with equation =month(A2), then run the countif on that column... If you still wanted to use text month('APRIL'), you would need a lookup table to reference the name to the month number. Otherwise, just use 4 instead of April on your metric sheet.
use count instead of sum in your original formula u will get your result
Original One
=SUM(IF(MONTH('2013'!$A$2:$A$19)=4,'2013'!$D$2:$D$19,0))
Modified One
=COUNT(IF(MONTH('2013'!$A$2:$A$19)=4,'2013'!$D$2:$D$19,0))
AND USE ctrl+shift+enter TO EXECUTE
Recommend you use FREQUENCY rather than using COUNTIF.
In your front sheet; enter 01/04/2014 into E5, 01/05/2014 into E6 etc.
Select the range of adjacent cells you want to populate. Enter:
=FREQUENCY(2013!!$A$2:$A$50,'2013 Metrics'!E5:EN)
(where N is the final row reference in your range)
Hit Ctrl + Shift + Enter
Sooooo, I had this same question. here's my answer: COUNTIFS(sheet1!$A:$A,">="&D1,sheet1!$A:$A,"<="&D2)
you don't need to specify A2:A50, unless there are dates beyond row 50 that you wish to exclude. this is cleaner in the sense that you don't have to go back and adjust the rows as more PO data comes in on sheet1.
also, the reference to D1 and D2 are start and end dates (respectively) for each month. On sheet2, you could have a hidden column that translates April to 4/1/2014, May into 5/1/2014, etc. THen, D1 would reference the cell that contains 4/1/2014, and D2 would reference the cell that contains 5/1/2014.
if you want to sum, it works the same way, except that the first argument is the sum array (column or row) and then the rest of the ranges/arrays and arguments are the same as the countifs formula.
btw-this works in excel AND google sheets. cheers
I am working with Microsoft excel 2010. I have different dates like column E1:E19 that are not in specific interval. I want help to find only starts month date and paste them into G column like shown into the figure.
First of, is to say - both K_B and Ibrahim Odeh have valid and good attemps. I just want to add another option, because those options use additional rows or manual tools.
Here is the formula I came up with to solve this as shown in your screenshot - just one column, just the rows with the starting dates:
G1=SUBTOTAL(5,E$1:E$19)
G2=SUBTOTAL(5,OFFSET(E$1:E$19,MATCH(EOMONTH(G1,0),E$1:E$19,1),0,ROWS(E$1:E$19)-MATCH(EOMONTH(G1,0),E$1:E$19,1)))
It is possible to use this for the whole column, like this:
G1=SUBTOTAL(5,E:E)
G2=SUBTOTAL(5,OFFSET(E:E,MATCH(EOMONTH(G1,0),E:E,1),0,ROWS(E:E)-MATCH(EOMONTH(G1,0),E:E,1)))
And now, some explaining:
First, you need a starting point in G1 - so we use SUBTOTAL to get the earliest date in column E, using MIN (which is 5).
Now we work from here, by offsetting the range which we use to calculate our SUBTOTAL, still using MIN (5), to get the beginning of each month.
The trick is OFFSET. The first parameter is out basic range, which we will offset, then we have to determine how many rows to offset, and to not get an error, we use ROWS(basicRange) - rowOffset to always stay in out range.
MATCH is used to determine the necessary offset, by looking for the row of the last listed date of the month from G1 using EOMONTH.
Hope this clears any question.
Edit:
Because I do have to translate this, here is the original:
=TEILERGEBNIS(5;E:E)
=TEILERGEBNIS(5;BEREICH.VERSCHIEBEN(E:E;VERGLEICH(MONATSENDE(G1;0);E:E;1);0;ZEILEN(E:E)-VERGLEICH(MONATSENDE(G1;0);E:E;1)))
as long as your dates columns is sorted as it looks in the example then do the following:
insert a row above row 1 (for use of the formula)
enter a formula in column A in all rows that your table has. The formula reads:
=If(NOT(YEAR($E2)&MONTH($E2)=YEAR($E1)&MONTH($E1), MAX($F$1:$F1)+1, "")
This will add increasing numbers from 1 to the number of months involved only next to the first date in your table for that month.
Then in your table in column G put:
=VLOOKUP(ROW(), A:E, 5)
you can drag this formula down as far as you want. The formula finds the first record in A:E that matches the row number in G (ROW() in G1 returns 1), Then VLOOKUP() will return the value in the 5th column in A:E (which is column E with the date).
The Formula in column A should be to the left of the dates for the VLOOKUP() formula to work.
Alternatively you can put it in a column to the right but then use another formula in stead of VLOOKUP() in column G:
=SUMIF(F:F,ROW(),E:E)
This sums all values in E for rows where the value in F matches the row number of the cell in G.
I think you need to use analysis-toolpak Add-on to perform this task:
check out the following URL if you need to know how to load it:
http://office.microsoft.com/en-us/excel-help/load-the-analysis-toolpak-HP001127724.aspx
Regards