Struggling a little with two multi conditional formula issues at the moment:
The first is I have a number of dates in Column B of a sheet (that represent the date something was created) and I am trying to make a formula that will allow me to have all the dates that are 90 days to 179 days old (from the date they were created) shade yellow and all the dates that are 180 days old and above shade red. I also need all dates that meet neither of those conditions (0 to 89 days old) to stay normal. This would obviously use the TODAY feature to constantly update based on the date.
The second issue is in Column N I need to show the date in column B plus 90 days, but if there is no information in column B, I need it to show nothing. I can make this work with a very simple N = b2+90 but that obviously means the cell will contain '90' if no date is yet applied in b2.
Any help would be appreciated, I can generally make one of these conditions work but not all at the same time. I have trawled the web for answers but making a formula to meet all those conditions is proving difficult.
Thanks
For the second issue, use an IF statement
=if(B2>0,B2+90,"")
For the first issue, start by building the logic into worksheet cells temporarily, then combine them with OR() or AND() functions and once you have them working, get them into a Conditional Formatting formula.
A progression of helper formulas would be like the following, who each return either a true or a false.
=TODAY()-B2>=90
=TODAY()-B2<180
=and(TODAY()-B2>=90,TODAY()-B2<180)
The last one above is the formula needed for the yellow rule.
And the red rule should be fairly obvious
=and(B2>0,TODAY()-B2>=180)
Apply these two rules to cell B2 and copy the format down with the format painter or in the "apdpdlies to" section of the Rule Manager.
In N2,
=if(count(b2), b2+90, text(,))
Create two conditional formatting rules based on these formulas,
=and(today()-b2>89, today()-b2<180) <~~yellow
=and(count(b2), today()-b2>=180) <~~red
For the first question:
Setup two conditions, the first one, to colour the cells yellow should have the following formula:
=IF(ISBLANK(I13),0,DAYS(TODAY(),I13))>89
And the second one, to colour them red should have:
=IF(ISBLANK(I13),0,DAYS(TODAY(),I13))>179
Answering your second question:
=IF(B2="","",B2+90)
*Formulas edited so result isn't true if cells are blank
Related
I have been struggling with these two problems for the better part of the day. Please see this link to an example: https://docs.google.com/spreadsheets/d/1odU7oqc-WviLzQcghkbYbQG-4DC70-Q_hszb22Chljw/edit?usp=sharing
This is a simplified document I use to see which lecturer (name) has has added which of the 5 documents (on the right) to an online learning environment (one row for each course). The courses can be given in semester 1, 2, or in both. I want to use this document to automatically highlight a name if any of the five boxes on the right is empty if the semester I want to check (Cell D1) is similar to Column E. Furthermore, only the first time a name appears in red, should the e-mail appear so as well.
For this, I of course use conditional formatting (please see those formulas, also pasted in column M (range column C and D) and N (Range column D). N is the white conditional formatting overruling M, in which a N="TRUE" means it is whitened out).
Example 1 (Ans) shows how I intend the programme to work. The first instance shows shows both the name and e-mail in red, later instances do too unless the semester is not similar or all boxes on the right are ticked.
Example 2 (Bertrand) shows the first problem. If the first instance of a red name and e-mail occurs in a semester 'both', the second time the name should be red the e-mail does so as well. This keep occurring until a semester is similar to Cell D1, after which it is normal again.
Example 3 (Carel) shows the second problem. If the first instance in which a certain lecturer occurs all boxes on the right are ticked, the second time he occurs but does not tick all boxes his name shows in red but his e-mail doesn't.
I think problem 1 (example 2) is solved if I can get 'both' to somehow mean both 1 and 2, but I don't know how.
I think problem 2 (example 3) is solved if I can get COUNTIFS to ignore the rows is which all five boxes are ticked.
However, I have no clue how to do this. Is anyone able to help me with either (but ideally both) problems?
Thank you in advance!
I'm not entirely sure, but I think I've understood what you need.
For the first part (where a lecturer has less than all 5 subjects containing 'x' AND where E is either the value of cell D1 or the value of 'both'), try this:
Delete both of your existing conditional formatting rules.
Create a new conditional formatting rule for range = C4:C21 (or perhaps further down your sheet to row 977), with a custom formula of:
=AND(COUNTIF($G4:$K4,"x")<5,or($E4=$D$1,$E4="both"))
The style for the rule should have a red background.
For the second part (updated), this is a bit tricker with conditional formatting but I can offer a solution determined by the value of cells, like you had.
Delete the contents of cells M4:N21 (21 being where you have a formula in the furthest cell).
In cell M4, add the following formula:
=arrayformula(if(iferror(if(ifs(E4:E=$D$1,1,E4:E="both",1)+if(G4:G&H4:H&I4:I&J4:J&K4:K <>"xxxxx",1,)=2,D4:D,),)<>"",countifs(iferror(if(ifs(E4:E=$D$1,1,E4:E="both",1)+if(G4:G&H4:H&I4:I&J4:J&K4:K <>"xxxxx",1,)=2,D4:D,),),iferror(if(ifs(E4:E=$D$1,1,E4:E="both",1)+if(G4:G&H4:H&I4:I&J4:J&K4:K <>"xxxxx",1,)=2,D4:D,),),row($E4:$E),"<="&row($E4:$E))=1,))
It might seem a little complex, but it's done this way to use the functions that are compatible with ARRAYFORMULA so that it will keep working down the sheet as far as you have values in rows.
Now create a new conditional formatting rule for range = D4:D21 (or perhaps further down your sheet to row 977), with a custom formula of:
=$M4=true
The style for the rule should have a red background.
I am attempting to make a cheat-sheet for paperwork that needs to be submitted at a specific date. Cell A8 is the given date; cells B8-F8 have formulas to generate dates based on A8's given date. I want cells B18-F8 to turn red 3 days before the generated dates, and stay that way until the due date passes (for now).
I have tried: =$FD8<=FD8 - (3) with every variation of "<,>,<="
Most solutions me to use "TODAY()" but I specifically want it to go off of the given date.
Can anyone point me in the right direction? Thanks!
It would be most convenient to use another set of cells to generate the B8-F8 dates and to substract three days. For example, B9-F9. Then you can use conditional formatting to format B8-F8 based on the B9-F9 values.
To substract days you can generate a VBA code that creates a custom function.
Function myDateAdd(interval, howmany, adate)
myDateAdd = DateAdd(interval, howmany, adate)
End Function
Or write a more elaborate formula
=IF(
DAY(B8)>3,
DATE(YEAR(B8),MONTH(B8),DAY(B8)-3),
DATE(YEAR(B8),MONTH(B8)-1,(DAY(B8)-31)*-1)
)
You still need to write something extra to verify that the B8 date has 31 (or 30 or 28) days. Combine IF() and ISDATE() multiple times to achieve this.
I'm trying to create an Excel sheet that will be tracking some of our autonomous processes and their access privileges at my company and I've run into an issue with Excel..
I'm trying to alternate row colors, which in and of itself isn't an issue, however the fact that I've got merged rows are giving me issues.
As of right now I've got 5 columns with headers in A through E. Column F is being used for conditional formatting to color the rows. In column F this formula is present:
=MOD(IF(ROW()=2,0,IF(A2=A1,F1, F1+1)), 2)
This works great if I want to repeat the leading Column item over and over, however I'd like to reduce the visual clutter and increase clarity, so I've merged some of the rows in the Column A because multiple rows in B:E correspond to it.
I've merged A2:A4 right now and the formula picks up the A2 and A4 as blank, but A3 (the text in the merged cell is centered) is recognized as different that A2 and A4 because the text resides there. I'll upload an image to give a better idea of what I'm talking about as well.
If anyone can give me a tip on how to alternate row colors with merged cells/rows that'd be great, I've done a lot of googling and searching on stackoverflow, but for the most part I've only found things that pertain to unmerged rows/cells.
Image Example: https://imgur.com/a/UDbRVWA
=IF() Condition that worked for me:
=MOD(IF(ROW()=2,0,IF((A2=0),IF((OR(A1<>0,A2=A1)),F1, F1+1),F1+1)), 2)
There is an answer below with a picture I posted, however, for most situations I would recommend the method suggested by #BruceWayne. It's far more sensible than working with merged cells!
I ended up finding a solution with just some clever working with the Conditional IF() statements. I think the key was taking into account that the Merged Cells that weren't the top (i.e. If I merged A2:A4, A2 is top, A3, A4 bottom) were equal to 0 while the top was set to the value of the text within the merged cell. Using the formula below I was able to achieve the result I was after:
=MOD(IF(ROW()=2,0,IF((A2=0),IF((OR(A1<>0,A2=A1)),F1, F1+1),F1+1)), 2)
And here is a linked screenshot: https://imgur.com/a/gNaC62c
I then just added conditional formatting for every row but row 1: =$F2=1. I'll be hiding column F to make it seem less obtrusive.
For future reference, I would agree with what #BruceWayne mentioned in that a simpler formatting that gets the job done would be preferable. There are many other ways to format this in a way that makes much more sense, but I felt like I was close when I was tinkering with it, so I stuck with it another 15 minutes or so and was able to pull out a usable formatting condition.
Might I make a suggestion? If the merging rows is to increase clarity with repeated entries, perhaps we can use another Conditional Formatting rule to make it more legible.
Say you have data that looks like this:
But, we don't want to see <Process #> duplicates in the A column. We could merge these cells and center it along the rows. But again, merging cells is generally frowned upon I've found. (It makes it tricky to format, conditional format, copy/paste, do any VLOOKUP()/Index/Match, etc.)
First, let's get the rows alternating colors. I'm using fill of RGB(183, 255, 253):
New Rule 1 -
Formula: =MOD(ROW(),2)
Applies To Range: $A$2:$E$9
Format: Fill with color RGB 183, 255, 253 (...or whatever you want, just note the RGB for later)
Now, we get this:
Okay, making progress. Now, let's work on hiding the duplicate values in column A.
So, let's apply some more Conditional Formats. We'll need two for column A, one to set the font to White, one to set the Font to that blue fill color.
New Rule 2 -
Formula: =AND($A3=$A2,MOD(ROW(),2)=1)
Applies To: =$A$3:$A$100
Format: Font --> Color --> RGB(183, 255, 253)
New Rule 3 -
Formula: =AND($A3=$A2,MOD(ROW(),2)=0)
Applies To: =$A$3:$A$100
Format: Font --> Color --> White
Now we have:
IMO, we can do one more thing to clarify the breaks in Processes:
New Rule 4 -
Formula: =$A2<>$A1
Applies To: =$A$2:$E$100
Format: Border --> Top Border
Now, we have a nice new CF table.
i have this formula =IFERROR(VLOOKUP(H4,Names!A:Q,16,0),"N/A") it works but only takes the top cell value and i need it to add up all cells in the row matching the value in "H4"
table extracting data from
table extracting data too, where the formula in question is used
here is the example, i need the rows connecting to "mac" to add together in a separate table cell eg: 19:00 = 31, 20:00 = 38
can anyone help with this?
Try this,
=sumifs(p:p, a:a, h4)
By the looks of it, you have merged cells in Names!A:A - so have brought problems on yourself. One solution is to unmerge (and avoid ever merging anything ever again!) and if you only want each Name to be shown the one time fill in the other instances but avoid displaying them (such as by blending the font colour into the background colour - such as with Conditional Formatting).
The filling in is easy with the technique here.
Then #Jeeped's solution should serve, provided you qualify the ranges with the sheet name:
=SUMIFS(Names!P:P,Names!A:A,H4)
To start I have all the days of the month going across row 2 using up columns G through AI.
I also have in row 3 from columns G through AI the following function =IF(G$2=TODAY(),1,) This function changes according to the column: H$3, I$3, J$3 … etc to AI$3
Below this are series of tasks that are divided by date depending on what is being done that day so I will refer to this area as the ‘task area’.
What I’ve been using in the task area is the conditional formatting “Use a formula to determine which cells to format”. When I reference the first column I use $G$3=1 and then apply the formatting to this column (in this case border the left and right side of all cells affected) and it works fine. I’ve run into a problem in that I now have to set up a rule for every column from G3:AI3. It is workable but not what I would like to ideally have set up, and it creates in some months 31 rules (this example 28 as I’m working in February) that are in existence to provide the formatting effect I want.
I’m wondering if there are any suggestions or directions to achieve the ideal which is one rule that can apply to the entire task area, but be able to work within the parameters, in this case the date of each individual column?
I have tried using the formula G3:AI3=1 but this comes back as an error as the rule for the conditional formatting. I have toyed with using cell values but as it stands the task area already has conditional formatting applied and found this conflicted with this conditional formatting, and really didn’t look the way I was hoping anyway. I hope this is clear, thanks for any suggestions.