Macro Or Equation To Have Cell Turn Red / Green Based On Value Of Another Cell?
Oct 23, 2013
I am attempting to create a ROI calculator for my place of work. I want a blank cell to fill in green or red based a cell below it being equal or greater than 5.0%. What is the Macro or equation to do that?
can I set a cell in excel so that if a number in a different cell is above a certain number it will turn green and another cell to turn red. I have attached the file.
I have attached a small file with a very simple conditional formatting formula used to turn a block of cells green.
However, the formula does not seem to work properly as it only turns half of the cells green. Columns B1 to B18 are also supposed to turn green, but instead remain clear.
I've set a conditional format to flag the row green if cell e2 has a Y or a N in the cell.
Currently i have the following conditional format formula is as
=IF($E$2="y",TRUE,FALSE) this is set to change row to green =IF($E$2="n",TRUE,FALSE) this is set to change row to red
My Questions =
What i want to do is copy this formula through the 500 or so rows and have the formula adust to =IF($E$3="y",TRUE,FALSE) For row 3 =IF($E$4="y",TRUE,FALSE) for row 4 =IF($E$5="y",TRUE,FALSE) for row 5
Ect.
I've tried using the formate painter but all it does is set all row to conditionally format dependant on what is in Cell E2. Thoughts on how to copy this formula is conditional format so i don't have to manually adjust it line by line. Doing this 500 times over would be a pain.
I have a workbook which is set up to take an average heart rate of a participant from a series of data points. I have set the spreadsheet up before I have collected some of the data. (so I can review the project at the 3 months period and its an ongoing project).
The problem is that if there is no data in a participants column then excel correctly gives you readout of #DIV//0!. On my results page this #DIV//0! makes it hard to read the spreadsheet. Is it possible to get excel to turn #DIV//0! to 0 or even turn it to a blank cell?
I am trying to figure out how would be the best way in VBA to identify if a cell is colored green (column C) then in column L I want to say "YES" else nothing.
I have came up with a count so I know how many records to look at but have nothing from there.
Public Sub KPI() Dim cls As Object Dim i As Integer Dim rng As Range Set rng = Range("C9:C100") For Each cls In rng If cls.Value "" Then i = i + 1 End If Next End Sub
Lets say I write an equation on my sheet such as: ='A1'!$H422*AH$138
but instead of hard coding the A1 sheet name, I want that to be a value that I can put in a different cell (lets say cell C1) on my same sheet in such a way that it will reference the value in my other cell (Cell C1) and put its value into that equation.
So if I make the value in C1 = A99 then the equation becomes ='A99'!$H422*AH$138
I am trying to type in a basic equation in a single cell (343.56 + 46.78) and I want it to be solved in another cell. Can this be done? Can I put this function in a cell where the cell it is trying to solve is not yet put in?
I will like to ask, if there is a way to get in a cell the result of a simple equation without having to copy the contents of that cell with a = in front for example if i have in one cell
I have five columns D3 to H3 all with different amounts/currency value. I'm looking to get a formula or use conditional formatting to scan those five cells and highlight one of them green when Excel has determined which one is the cheapest out of the five.
In a column in my spreadsheet i have to input a number; either: 51-61 and next to it is either m or o. so in Column A row 1 : 51m, Column A row 2 60m, etc Example:
51m 51o 55o 60m
I want to conditionally format this such that for 51 it turns the cell background green, for 52 red, 53 orange,etc. with a number having a specific color associated with it. 03' does not have a text choice.
I have two cells (c1 and c2). c1 contains (2+3*4)*3 without "=" at start. c2 must contain the result of c1 it means 42. I think it has a very simple sulution but I don't know it. In the attached file I have a few variants I tried to solve it but they both don't fit.
I want to add a hyphen to 2 particular cells if they are blank. The form is populated from another software package with dimensions. If Columns D and E have any blank cells, want to insert a hyphen. Can't use VB because the particular software package will only output to a template with .xlt
If can't do with Conditional Format, then okay I can tell the inspectors to use add by hand
I know I can right click in cell and choose from the items, but can I actually make the cell a drop-down box, like on websites? Meaning, can I choose which options/numbers/letters/choices I want in the drop down, and be able to right click and highlight one?
Been racking brain, searching through the forum here, and my Excel 2003 Bible all day trying to figure out this problem to no avail. I would like to clear the contents of any cell in a given range if the cell immediately to the right of is formatted as bold.
I run a catalogue of music (thousands of records) made in excel where I have in the first cell the name of the band + album + format, something like this:
Pearl Jam - name of the album - CD
how can I turn automatically all names of bands into CAPITALS, in example:
PEAR JAM - name of the album - CD
Is there a way to turn in CAPITALS all text from the beginning of a cell 'till the symbol with spaces on both sides ( - ) of each cell ?
I know how to turn the entire cell into CAPITALS using the formula =upper(column nş) but not just part of the cell.
I have a spreadsheet where if Cell A2 says "Deposit", Rows A2-E2 would be formatted with a Blue background.
I've tried conditional formatting, but I can't built it into a Macro (I can't make it run), and it only highlights the cell that has that value. I also tried having the spreadsheet filter down to only the values I want highlighted, then highlighting all cells and un-filtering the column- this didn't work either.
It would basically say :
If (any cell in Row A) has text = "Deposit" (it needs to be exact, it can't be "containing"), set cell with the word "Deposit" and 4 cells to the right as Blue (I'm not picky about the color).
I did a search on this site and found some code I was looking for (see link:
http://www.excelforum.com/excel-prog...e-in-cell.html - Leith Ross's response code).
The code works perfectly, however, if I save the workbook with a different spreadsheet on top than the spreadsheet referred to in this code, I get an error message: Method 'Range' of object '_Worksheet' failed.
I should state that I did change "Private Sub Workbook_Open()" to "Private Sub Auto_Open()".
I assume I need to modify the code but am unsure as to how.
I am writing a function that opens up an external excel document, identifies a string in a certain range and then i also want it to return a cell reference for that string including the number of rows beneath the cell that the string was found in.
Basically, I need to reformat a set of data (see before and after). A specific column should only contain 1 value, if there is more than 1 value it will be separated by a comma. If this column contains more than 1 set of data then I would need to insert a row and duplicate the information based on how many different sets there are. All the copied data should remain the same with the exception of the "Key" column, it should only have 1 value and each copied row should contain the corresponding value in the key field.
BTW - it could be on the same sheet or a different worksheet (doesn't matter)
BEFORE Name Number KEY Date Name1 1 a,b,c 12/1/2011 Name2 2 x 12/1/2011 Name 3 5 one,three 12/1/2011
AFTER Name Number KEY Date Name1 1 a 12/1/2011 Name1 1 b 12/1/2011 Name1 1 c 12/1/2011 Name2 2 x 12/1/2011 Name 3 5 one 12/1/2011 Name 3 5 three 12/1/2011
to create the following formula which I'm now repeating in more elaborate forms. At the moment I am using the formula below but I need to get the bit in red in the second half of the formula to search on more than the one condition.
Currently it is searching a postcode abbreviation field and is picking up all those with 'BS' however I don't just want to search on BS. I would like to search on BS, BA, SN, TA, GL. I have tried putting different combination using commas and plus signs etc in but excel doens't seem to like the way I'm doing it.