conditional-formatting

How to apply conditional formatting to color partial text string?

别说谁变了你拦得住时间么 提交于 2019-12-25 18:55:33
问题 Is there a way to adjust the Excel VBA code to find and color a specific part of the text string found? I am using the following code to find and highlight all cells with text string "@gmail.com" and "@yahoo.com" in column V. The text string in column V is like this: BBC43555;johnsmith@gmail.com;77888857778;phone:0018888889 It cannot be divided into columns because it may contain different number and order of information fields combined in it. I would like to highlight only the specific text

Conditional Formatting based on previous cell value

冷暖自知 提交于 2019-12-25 16:40:06
问题 I'm looking to apply Conditional Formatting to a range of data I have in Excel that will display red if the most recent day of data is below what it was before, and green if it was higher. Eg Day,Value, Highlight cell colour Day 1 1000 Day 2 2000 Green - as it's higher than day 1 Day 3 500 Red - as it's lower than day 2 Day 4 6000 Green Day 5 4000 Red I want to replicate this for all my data and then ideally be able to count the number of 'runs there are' eg number of red cells together so

Conditional formatting if cells are within a range of each other

荒凉一梦 提交于 2019-12-25 05:06:47
问题 Using Excel 2013. I have a long list of numbers in column A. I would like to conditionally highlight any cell that is in a range of +/- 5 with respect to the number above it OR the number below it. For example, if I have 1, 1, 10, 20, 21, 22, 50 (in this order) the cells highlighted should be the ones containing only 1, 1, 20, 21, 22. 回答1: Please try: =OR(ABS(A1-A2)<6,ABS(A2-A3)<6) The maximum difference allowed is +/-5 which is a little simpler to express in a formula as not as much as +/-6,

Highlight duplicates, ignoring same row

淺唱寂寞╮ 提交于 2019-12-25 03:27:40
问题 I have a worksheet containing names in 2 dimensions. Each row represents a general location, every other column represents a specific slot in that location (each location has the same number of available slots), alternating with a parameter belonging to that name. There is a name in each cell. Here's a simplified version to show what my data looks like: Location 0 ( ) 1 ( ) 2 ( ) 3 ( ) Garden Tim 3 Pete 1 Oscar 1 Lucy 2 Room1 Lucy 1 Tim 1 Lucy 5 Anna 1 Kitchen Frank 1 Frank 2 Frank 1 Lucy 1

Conditional Formatting of a value based on Yes or NO

旧城冷巷雨未停 提交于 2019-12-25 02:22:42
问题 I have two ROWS, one has values and the other Yes or NO . I want the values in ROW 1 to be colored according to whether Yes or NO in ROW 2 in the corresponding column. For example: ROW 1 XXXX|XXXX|XXX|XXXX ROW 2 YES | NO |YES| NO There are no conditions to why ROW 1 should be yes or no, it's just the way it is. Is it possible? 回答1: In conditional formatting, use this option: And write this formula: =If(B2="Yes",1,0) And assuming your data is like this: So, the highlight in Row1 changes

SSRS conditional formatting column with alternating row highlighting and NULL handling

五迷三道 提交于 2019-12-24 21:33:26
问题 I have an SSRS report where I'm supposed to conditionally format a column red/green depending on if an expression is +/- 5% (less is good, so less is green). I also need to have the entire report have alternating row highlighting. I can get these to function correctly until I throw in some NULL handling. =Switch ( IsNothing(Sum(Fields!August2015.Value)),IIf(RowNumber(Nothing) Mod 2 = 0, "#d9d9d9", "Transparent"), (Fields!August2015.Value-Fields!CorporateAvg.Value)/Fields!CorporateAvg.Value >=

Openpyxl: unexpected fail with CellIsRule function

試著忘記壹切 提交于 2019-12-24 20:32:23
问题 I am opening an Excel file and applying some conditional formatting: from openpyxl import * from openpyxl.formatting.rule import CellIsRule os.chdir(r'C:\Users\myfolder') wb= load_workbook('myfile.xlsx') ws = wb.active #Conditional formatting ws.conditional_formatting.add('S3:S89', formatting.CellIsRule(operator='equal', formula=['1'], font='#FF0000')) #Red This was done based on this answer. However, I get this error: AttributeError Traceback (most recent call last) <ipython-input-190

How to use AverageIf worksheet function for calculating average date differences (in case date is filled in)

喜你入骨 提交于 2019-12-24 20:16:11
问题 I'm making a summary of a list of tasks, and the corresponding dates (start date, first answer date, ...). It looks more or less like the following: Title Start date First answer Task1 29/06/2018 02/07/2018 Task2 09/05/2018 Task3 13/06/2018 14/06/2018 I would like to calculate the average time, needed for the first answer to be given. In case no first answer is given yet, this entry needs to be ignored in the calculation of the average. In order to be able to understand the formulas better, I

Conditional format based on non-blank previous cell

江枫思渺然 提交于 2019-12-24 20:00:19
问题 I need to conditionally format cells in a row based on the prior non-blank cell A B C D E F G AC BW IN BW BC ST IN Because B1 is AC, i want C1 and D1 to have a conditional format (changed fill which will match the format in B1). That ends when i get to E1 and the value BW. On row 2 i want to ignore b2 and only format d2. The values in that will turn the formatting on come from a list of values i.e. AC, BC, IC, SC. currently i have conditional formatting that looks for the list and can format

Setting Excel FormatConditions Font Color Run-time Error

扶醉桌前 提交于 2019-12-24 10:57:12
问题 I am receiving a run-time error '1004' on the line .Font.color = vbRed when setting conditional formats. The Sub works great on Excel 2011 for Mac, but fails on Windows. I've tried rearranging the code, using RGB(255,0,0) , setting .ColorIndex , as well as recording a macro and using that code. All failed in windows. I'm trying to set the font color to red if the cell begins with "Med". The sub is called from here: Public Const BASE As String = "$D$14" Dim cols As Long Dim rows As Long Dim