Excel - Conditional formatting and field name look up - excel

What I need to do is find which cell in a row is the lowest value and highlight it. Very simple, I can do this. However, I cannot figure uot how to copy this conditional formatting into the proceeding rows. I have tried "Paste Special > Formats" to no avail.
Also, in a separate column, I to display the field name9column name) of the specific cell that has been returned with the lowest value.
Any suggestions?

I see two questions:
First, how to copy conditional formatting. Simply select the formatted data, click the "Format Painter" tool on the Home tab, and select the additional data you wish to format.
Second, how to display the cell with the lowest value.
Use the MIN function to do this. If your range is A1:A100, use =MIN(A1:A100)
Use the following: =INDEX(A1:E1,MATCH(MIN(A2:E2),A2:E2,0))
A1:E1 is the range containing your column names. A2:E2 is the row with your values. Note that if the values are not unique, this will return the first instance of the minimum value, starting from the left.

Related

Microsoft Excel - Conditional Formatting to match cell in column to cell in same row of different column

I have a workbook created in Excel 2013 that every engineer at my job has to use to check data that was input into a system. We are able to export the files into XLS, and I created a macro to pull all the data and conditional formatting to display "errors" that need to be fixed.
We are in the process of versioning the workbook, and to do so I am trying to get some more complicated formulas out there to check the data. There are several columns that need to be cross checked in one check, because they should match. This means i need a formatting rule to look in any given cell in a column, and check other cells in the SAME ROW, but DIFFERENT COLUMN, and make sure they match..
For example:
Column A is Label ID Text, and in this case it says 1 - 1.5" HDPE.
Column B is the Duct Count, which is 1
Column C is the Duct Size, which is 1.5"
and Column D is the Duct Type, which is HDPE.
I the Label ID text to take the 3 separate parts of the string, and match it to other columns. If it doesn't it highlights the column B-D that doesn't match. I manually created an example of what I need it to do.
Example:
So this involves working with strings, specifically the functions LEFT, RIGHT, MID, and also being mindful of how you're comparing items.
It all involves being meticulous in how you're separating the values from the string in your first column. In order to test all your function, start using empty cells to slowly build up the formulas to assemble the overall logic.
In figuring out your duct count, you can see you want "the number to the left of the dash character". So you'll start this way...
=FIND("-",A2)
You only want the characters to the left of the dash, so use the LEFT function
=LEFT(A2,FIND("-",A2))
Which returns a value of 1 -, but you don't want to include the dash, so subtract one.
=LEFT(A2,FIND("-",A2)-1)
Now if you compare this value to your Duct Count in column B, you'll get
=LEFT(A2,FIND("-",A2))=B2
Which gives a value of FALSE. This is because the result of the LEFT function you built is a string "1 " and not a number. So use another function to convert it to a number
=NUMBERVALUE(LEFT(A2,FIND("-",A2)-1))=B2
Now you get the correct result of TRUE.
So highlight cells B2:B5 and select Conditional Formatting-->New Rule. Then choose "Use a formula to determine which cells to format". Then type in your formula (the whole =NUMBERVALUE thing) and select your format. And you're done with that column.
Continue to work out how to separate the values for the other columns. If you have more questions we can help.
Please clear any existing CF from ColumnsB:D, select them and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=NOT(OR(B1=--LEFT($A1,FIND("-",$A1)-2),B1=MID($A1,FIND("-",$A1)+2,FIND("-",$A1)+1),B1=MID($A1,FIND("""",$A1)+2,LEN($A1))))
Format..., select choice of formatting, OK, OK.

Excel: Highlighting a whole column depending on date

I have made my own Gantt chart in Excel, which is shown in this picture:
.
I would like to highlight the whole column (or until the last activity) depending on the date, as shown in the picture. I figured out how to highlight a single cell depending on the date, but not a whole column.
I don't know how to do it short of entering the date into the whole column, but I thought there would be something more efficient if conditional formatting is used.
If you'd like an entire range to conditionally format based on the value of one of the fields in the range, use an absolute cell reference. I couldn't figure out perfectly from your picture which cell contains the date, but I'll try to give you an example.
If you have dates in the Cells in Row 1, and you want to highlight the entire column when the row has today's date, the conditional format formula would look like below. (Assuming today's date is in cell C1, then the entire column from C1:C25 [the range upon which I applied the conditional format] will be highlighted).
Steps:
Highlight the entire range upon which you want to apply the formatting. In my example, I'm using range A1:H25
In the Excel Ribbon, select Home > Conditional Formatting > New Rule...
On Windows, select Use a formula to determine which cells to format. On macOS, first choose Classic from the Style dropdown menu and then from the second dropdown menu, pick Use a formula to determine which cells to format.
The formula will be =A$1=TODAY() [NOTE: We check cell A1 first because it is the first cell in our highlighted range. We choose $1 because the dates are always in Row 1. Change that to suit.]
Select the format you'd like to apply
To test out how it looks, press OK

Unique value in excel

I have an array of numbers in Excel spanning from Cells B1 to F49. Out of all those numbers I want to find out the unique values, in other words, no duplicates. I tried using Remove duplicates but it looks at the rows and not the individual cells. What would be my best option for doing this? any help would be greatly appreciated.
You could try this array formula that returns unique text or numbers from a rectangular range.
Select a range to output the results to eg: H1:H245
Copy and paste the formula below into the formula bar.
Press Ctrl+Shift+Enter to enter into the range.
=IFERROR(CELL("Contents",INDIRECT(T(IF(1,TEXT(MODE.MULT(IF(FREQUENCY(COUNTIF(B1:F49,"<="&B1:F49)+ISTEXT(B1:F49)*COUNT(B1:F49),COUNTIF(B1:F49,"<="&B1:F49)+ISTEXT(B1:F49)*COUNT(B1:F49))>={1,1},MODE.MULT(10^5*ROW(B1:F49)+COLUMN(B1:F49),10^5*ROW(B1:F49)+COLUMN(B1:F49)))),"r0c00000"))),0)),"")
I'd probably put this formula in column C: (or another empty column you have):
(so starting in cell C1: )
=COUNTIF(B:B,B1)=1
(and copy/paste the formula down)
It will return TRUE if it is unique. So you can then filter things out via Filter, or with other formulas down the road.
It may be easiest to just combine your information into one long column and run a remove duplicates. If this is not an option you may want to look at writing a macro to crawl through the records.
You could have a macro go through each column for the rows specified and determine if the CountIf function =COUNTIF(B2:F49,B2) returns a value >1
if it does there are at least 2 instances of this number.
I'm not sure how you want to identify your unique cells but you could potentially set a text color or return the values of the cell to another location.
Simplest for identification of values unique within the entire array may be to highlight the entire range with ‘standard’ formatting of choice for uniques, then select the entire range, Conditional Formatting, Highlight Cell Rules, Duplicate Values…, and choose a custom format of no fill and font of whatever you started with.

Highlight cells based on 10-15 values and post alternatives

I have a 1600-2000 rows of data in a spreadsheet that changes daily. I would like to highlight any row that contains such as 000000000000053851 in the R column. I had tried conditional formatting using this formula:
=OR($R1="000000000000549543",$R1="000000000000267294,$R1="000000000000053851")
but it seems to highlight a few rows that are blank in column R also.
Using the same numbers highlighted in column R, I would like to have an alternate number and possibly other data pasted into the corresponding row in column S. Each number has a unique alternate number and data to go along with it. This is how I picture a line may look with the highlighting and alternate data next to it:
I intend to record a macro using a few of the different steps that are likely required to do this. Any way, whether conditional formatting or an array formula, would be great to help with this.
For the sample provided, a CF rule of:
=LEFT(R1,12)="000000000000"
applied to ColumnR will format the sample and if you wish the cell immediately to the right. It will not highlight blank cells.
HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true:, enter formula from above and Format... with Fill red, OK, OK.
If you want the cell to the right to be formatted also, select ColumnsR:S instead of just ColumnR and change R1 in the formula to $R1.
For the cell to the right you provide few details but VLOOKUP in conjunction with a two-column table should suit. Column on the left being the ColumnR value, with the right-hand column for the same row the ColumnS value required. This table could be placed almost anywhere.
This could all be done with Record Macro.

How to conditional format based on multiple specific text in Excel

I have a spreadsheet that i use to determine when/what clients to contact when an issue arises. in the first workbook i insert a column every day and paste in information about any questionable habits from clients, including a client ID. unfortunately the data i am copying from also includes clients that are not to be contacted during an issue. i have a second page that has listed in column A all of the "dont check" client ids. is there a way to conditional format the original page to color any cells referencing a "dont check" client based upon the don't check listing in sheet 2?
EDIT: there is more than just client ID in the first sheet cells. client id is just included. the format is [(last file received date)(Client Name)(Client ID)(Last X file received date) (Last Y file received date)] all in one cell.
In theory what i would like is to go to conditional formatting, highlight cell rules, text that contains... then select A1-A45 on Sheet2 and click okay. obviously this is not possible. an error shows up stating "this type of reference cannot be used in a Conditional Formatting formula. Change the reference to a single cell, or use the reference with a worksheet function such as =SUM(A1:E5)
Thanks in advance.
You can use MATCH for instance.
Select the column from the first cell, for example cell A2 to cell A100 and insert a conditional formatting, using 'New Rule...' and the option to conditional format based on a formula.
In the entry box, put:
=MATCH(A2, 'Sheet2'!A:A, 0)
Pick the desired formatting (change the font to red or fill the cell background, etc) and click OK.
MATCH takes the value A2 from your data table, looks into 'Sheet2'!A:A and if there's an exact match (that's why there's a 0 at the end), then it'll return the row number.
Note: Conditional formatting based on conditions from other sheets is available only on Excel 2010 onwards. If you're working on an earlier version, you might want to get the list of 'Don't check' in the same sheet.
EDIT: As per new information, you will have to use some reverse matching. Instead of the above formula, try:
=SUM(IFERROR(SEARCH('Sheet2'!$A$1:$A$44, A2),0))
Suppose your "Don't Check" list is on Sheet2 in cells A1:A100, say, and your current client IDs are in Sheet1 in Column A.
What you would do is:
Select the whole data table you want conditionally formatted in Sheet1
Click Conditional Formatting > New Rule > Use a Formula to determine which cells to format
In the formula bar, type in =ISNUMBER(MATCH($A1,Sheet2!$A$1:$A$100,0)) and select how you want those rows formatted
And that should do the trick.

Resources