Cell Format Changes Depending On Formula
Jul 18, 2013
My formula works fine, but I need the first number of the answer displayed with only two decimal places. The formula averages a set of numbers, then adds " of " and a cell reference.
I want the answer displayed as 2.43 of 3. Here is the formula.
=IF(AVERAGE(W12:W123)>0,(AVERAGE(W12:W123))&" of "& Z9,"") it works perfectly but displays 2.42857142857143 of 3.
The cell is formatted to NUMBER with two decimal places. . Changing the format has no effect, but changing the formula does.
If I use =IF(AVERAGE(W12:W123)>0,(AVERAGE(W12:W123)) or =AVERAGE(W12:W123) the result is 2.43. When I add the next portion, &" of "& Z9,"") it changes to 2.42857142857143.
I've tried reformatting cells and nothing changes. This is the only cell I'm having problems with. The worksheet seems to be working fine.
View 10 Replies
ADVERTISEMENT
Jul 24, 2014
I want to create a system based on the value of a cell appearing as a grade in the adjacent cell. The cell could contain any value from -10 to +10.
the criteria would be
value greater than +2 = 3
value between 0 and +2 = 2
value between -2 and zero =1
value below -2 =0
I can get a formula to work for a single instance but not multiple conditions.
View 3 Replies
View Related
Feb 18, 2010
I want to be able to do the following: I have data in column a and I want the text to change to strikethrough in, for instance, cell a1 when data is entered in b1.
View 9 Replies
View Related
Apr 16, 2014
I have an if statement which shows either GP% or average revenue per product. The problem is that GP% needs to be in a percentage format and revenue per product needs to be in number format. 500 is now shown as 50000% or 50% will be shown as 0.5 for example. Is there anyway on changing the format of a cell based on the number?
View 1 Replies
View Related
Jan 27, 2014
In a macro I want to automatically insert a formula in several cells. The formula depends on other cells, and I want to be able to manipulate these cells with variables. Here is my code:
[Code] .....
All my variables are declared:
Sheets("DATOS YTD 2014").Cells(I, Semana + 1) is the cell I want to be able to chose due to the variables
Sheets("DATOS YTD 2014").Cells(I, 3) is the reference cell for the VLOOKUP formula, that will vary with I
SheetMonth.Range("B3:W172") is a range in the sheet SheetMonth which is fixed
The error message I receive is the following: "Run-time error 13, Type mismatch"
I precise that the next step is to make the ",6," part in the vlookup formula also variable... but I guess once my current issue is solved this one will be a piece of cake.
View 3 Replies
View Related
Feb 9, 2007
Is it possible to use a formula to shade a cell dependent on a condition? I have tried an if formula (see below) but it is incorrect. =if('November 2006 SVOC'!B6>'March 2006 SVOC'!C6,'November 2006 SVOC'!B6 [red],if('November 2006 SVOC'!B6<'March 2006 SVOC'!C6,'November 2006 SVOC'!B6 [blue],))
View 3 Replies
View Related
Aug 29, 2012
My colleagues are working on multiple projects at once. The projects got different priority, so I'm looking for a formula that change the cell color if a person is working on it, depending on the project's priority.
For example if John is working on project: East(pri.1), South(pri.2) and West(pri.3). On East he got 5 remaining hours (cell E8). Then i would like that cell to turn red. For South green and West red.
View 5 Replies
View Related
Aug 19, 2014
I have created a drop-down menu combobox of districts and depending on your choice of districts the list of Health Centers in each district changes. What I want to do is to protect the contents of the cells that contain the health centers. The problem is that when I lock the cells and I choose a district, the Health Center cells cannot change because the cells are locked. Is there anyway around it?
I have attached the sample (Please look at sheet 2. The column that I want to block is the column FOSA)
View 4 Replies
View Related
Oct 1, 2013
I need to build a formula to have one cell display multiple options depending on a value in another box.
If Value is >x and <x display Y
Details:
Cell D5 Holds a dollar amount. E5 is where the calculation will happen. Logically i need it to do the following exactly:
If D5 is between 5000 and 9999, display 75. If D5 is between 10000 and 14999 display 150. If D5 is between 15000 and 19999 display 200. If D5 is >20000 display 250.
View 2 Replies
View Related
May 18, 2007
I need a formula that displays the word "Day" or "Days" depending on cell entry i know the formlula =IF((B12)>0,"Day","") to show the word day but i want it to show "day" if a 1 is entered or "days" if any number over 1 is entered.
View 2 Replies
View Related
Dec 10, 2012
As seen from my attached file,
The colour of the percentage cell changes according to its percentage. I would like the S/N cells to have the same colour as the total percentage cells automatically. (Even when the percentage updates)
Secondly, for the cells under "Target", if the target dates are 1 day before today(the current date on a particular day) and the actual date is not filled, the cell fill will turn amber.
If today is on or after the target date and the actual date is not filled, the cell will turn red.
However, if the actual date is filled, the target date cell will be filled green, overwriting the above two condition.
FormattingHelpExample.xls
View 2 Replies
View Related
Jan 28, 2013
I have the following table in excel:
Price: Percentage:
$150 10%
$100 12%
$50 14%
I'm trying to use the percentage depending on what price I enter in a cell. For example; if I enter $135 then 10% will be used, if I enter $65 then 12% will be used, and if I enter $47 then 14% will be used.
View 3 Replies
View Related
Oct 24, 2008
.............................24............30............36
300014999..........9.00%.......11.00%.....12.00%
1500099999........9.50%.......11.50%.....12.50%
100000249999.....9.00%......11.00%.....13.00%
I need an all inclusive formula (all in one cell) that would look at the above table and depending upon the price paid (3000-14999 or 15000-99999 or 100000-249999) and depending upon what monthly term they choose (24, 30, or 36), the appropriate finance charge would be used to calculate a total cost (9-13%). The only way I know to do this is by using IF's and AND's, but there are simply too many arguments and I cannot properly write the formula.
View 4 Replies
View Related
Apr 4, 2013
I have a sheet with a country in it in A1 (validation list).
Depending on the country in A1 a country specific IF command has to be executed on a column1 with first cel = A3. This IF command also relies on the values in column 2 and 3 on the same row. (B3 and C3 are in the IF cmd)
I taught to do it like this : =IF($A$1="Spain";$A$5;0) with A5 being the country specific IF command which should be executed when spain is selected. however when I do this, this only works for the first cell ( I cannot drag this formule down, since it will always give the value calculated in column 2 and 3 on row1.
I'm not sure if the best way to 'select' the country specific IF cmd is with another IF command..
View 5 Replies
View Related
Mar 26, 2009
I want to format 3 columns in excel depending on certain value from another column.
By example: I have the columns A B C completed with some text. On the column D it will be the numbers 0 or 1. If the number is 0 the background color from A,B,C columns shall be Green, if the number is 1 the color shall be red.
I have tried in conditional formatting with the formula =$D$1=0 but the color of the columns are changing only depending on the value from cell D1. I don't know what is the correct formula. For column A1 I want to check the value from D1, A2 - D2, A3 - D3,...,An - Dn.
View 2 Replies
View Related
Oct 19, 2009
I want to colour 10 cells (A1-J1) if I type in yes in cell K1. Using conditional formatting Im only able to colour 1 cell. Is this possible without using VBA?
View 5 Replies
View Related
Feb 27, 2013
I am trying to format certain cells to change colors depending on the date and the content of the next field to show due dates.
cell label
due date
date completed
c5
au5
be5
c6
au6
be6
c7
au7
be7
c8
au8
be8
What I need is for the contents of au5 to be green up until 10 days before the due date, yellow up until 5 days, and red with less than 5 days until the due date. If the date completed is entered into be5, then the contents of au5 should be black.
Is this possible, and if it is, how do I set this up? I tried to use
=$AU5-TODAY()>=10
And choose green formatting (something I found on yahoo answers), but when I enter the date the text is still the original black font.
View 5 Replies
View Related
Jan 11, 2013
I need change the color of the cell depending on the following conditions. (By the way the column will have names list)
1. single punctuations are allowed anywhere in name apart from first position.-->color should not change
2. If any name got consecutive punctuations --> color should change to RED.
3. Any punctuations apart from Dot(.), hyphen(-), apostrophe('), Space( ) are not allowed-->color should change to RED.
Example-
ShivakumaraNo Change
Shiva kumaraNo Change
Shiva'kumaraNo Change
shiva.kumaraNo Change
shiva kumarared
shiva''kumarared
shiva' kumarared
shiva. Kumarared
shiva.'kumarared
shiva:kumarared
View 4 Replies
View Related
Mar 9, 2012
I have a graph which displays information from a vlookup.. The vlookup can bring either numbers which are in percentages format or ordinary number format.
The question I have is is it possible for the graph to automatically change format depending upon the information who is looked up..
If so how can this be done..
View 1 Replies
View Related
Oct 14, 2009
I am trying to format cells in a range that is not a formula. I tried a UDF and CF but would not work properly. Maybe due to a Bug in Excel.
Therefore created the code below:
I put this code in my ThisWorkbook Module.
What I am trying to accomplish is this.
Check the range of cells, if any cell is not a formula color the background Yellow and the foreground Bold RED.
The workbook has about 40 sheets 32 of them are formatted the same they are numbered "01-31" and 1 is "Temp".
This code works fine but the second procedure would not work when this 1 is there.
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim myCell As Range
Dim myIntersect As Range
Dim myAddresses As String
Dim SheetNamessToSkip As Variant
Dim res As Variant
SheetNamessToSkip = Array("Splash", "Menu", "Diesel", "Gasolina", "Alcool", "Prev Month", "Totals")
myAddresses = "G12:H51,P40:Q44,P48:Q60,Q14:Q17"
Both subs do what I expect them to do, but can not run them together.
I get a compile error when trying to do it this way.
View 5 Replies
View Related
Apr 27, 2009
Is it possible to do the following?
if cell A1 = 6 and cell A2 =5.8 (0.2 below A1) colour cell A2 orange
if cell A1 = 6 and cell A2 =5.5 or below (0.5 or more below A1) colour cell A2 red
if cell A1 = 6 and cell A2 =6.2 / 6.5 / 6.8 (0.2/0.5/0.8 above A1) colour cell A2 green
if cell A1 = 6 and cell A2 =7.2 or above (1.2 or above A1) colour cell A2 green
View 9 Replies
View Related
Nov 3, 2009
is possible to create a formula in a cell (A1) that calculates the average from an entire row of cells (B1:Z1) BUT only considers those cells that are formatted as a percentage. The row (1) contains cells that have percentages, dollar values, zeros, and blanks. If, for example, the entire row of say 100 cells has just 4 cells with percentages in them, how to get it to identify those 4 cells and calculate the average?
View 4 Replies
View Related
Nov 14, 2009
I wish to compare 2 sets of data in 2 cells and in the third cell i wish to both display the difference and format in a colour depending on the outcome of the difference. Is this possible? or is there another solution?
e.g cell A1 is 21
cell B1 is 26
cell C1 is the difference and if the difference is greater than say 2 then it would colour red if equal to 1 then yellow and if less than 1 as in 0 -1 etc it would colour green. I have been very successfully using conditional formatting to colour a cell that has the data inputted but cant now do it for the formula cell. The context is pupil progress but that i guess is irrelevant really.
View 4 Replies
View Related
Jan 25, 2012
I have a large spreadsheet with a number of columns that are set up for conditional formatting. For example a column of "BUY"'s and "SELL"'s where the "BUY"s are formatted with the default "light green fill, dark green text". I have other columns that are conditionally formatted using a formula. When I base the result on a formula I don't seem to have the option to use the default formats. Is it possible to use the defaults or maybe even how to customize my format to look like the default? It would look a lot better if I had a uniform red/green style throughout the sheet.
View 1 Replies
View Related
May 7, 2007
I have a workbook with two worksheets. I added a formula to the first worksheet
= COUNTIF(Scorecard!H3,"K"). It works fine when I add another COUNTIF that references another column (baseball fans may realize I'm counting total strikeouts for a batter): =COUNTIF(Scorecard!H3,"K")+COUNTIF(Scorecard!L3,"K") However, when I try to expand this to cover more columns, =COUNTIF(Scorecard!H3,"K")+COUNTIF(Scorecard!L3,"K")+COUNTIF(Scorecard!P3,"K")
Excel automatically changes the format of this cell to "Text" and it shows the formula as text instead of calculating it. What could be wrong here? Excel's documentation is woefully inadequate for cases like this. Is there an undocumented limit on how many times I can add COUNTIFs together?
View 5 Replies
View Related
Jul 27, 2014
The formula works on numbers but not on time with format cell : [u]:mm:ss
HTML Code:
8
7
6
11
12
HTML Code:
8:00:00
8:00:00
6:00:00
3:00:00
[Code]....
View 1 Replies
View Related
Jan 16, 2013
I have a large spreadsheet that I would like to indicate the location of the cells (Change cell color or text color) which contain formulas. My thought is that conditional formatting would be the easiest way...
View 3 Replies
View Related
Jan 10, 2014
I just upgraded to Excel2010 and noticed that if I calculate percentages resulting from other formulas, the result displays as a percentage with 15 decimal places and it ignores the format of the cell. My guess is that since formulas are being used in cells A1,B1, and C1, Excel is ignoring the format. When I hard code the numbers, I obtain the desired result.
Is there a way to change the default of 15 decimal places for formula results involving inputs that use formulas in their own creation? (outside of the Round function in each cell? Within Options?)
The data looks like this:
A1 = formula resulting in 1.76%
B1 = formula resulting in 1.90%
C1 = formula resulting in 1.69%
D1 = C1*B1/A1 resulting in 1.8218147382920100%
The desired result is 1.82%.
View 4 Replies
View Related
Mar 2, 2010
i have a sheet which is being used as a payment advise with subsidies.
depending on the product selected, it is either a $value multiplied by the qty or a % of the total value.
what i am trying to do as an example:
if cell F46 = percent(or sheet2 b6) it needs to multiply by cell H32
BUT if cell F46 = $ (or sheet2 B7:B11) it needs to multiply by cell B46
(sheet 2 has named ranges to be used in a list box)
View 9 Replies
View Related
Sep 26, 2009
i have a set of conditional formatting set up for my workbook, the first is simply that if the result is false the cell is blank(white text,white background). the second if positive result,keeps the text black till 1 year has passed. the problem is the third, i.m trying to allow the user to blank out the cell within the year (white text,white background)if certain criteria are met. the idea is that they change the entry in cell D from T to TX or from M to MX and the formula pick this up, but i keep getting a error saying "your formula contains an error", the formula im using is, =if(or($D5="tx","mx")) then i set the format to (white text,white background). its probably really simple but i,ve been trying to solve this now for around 8 hours and i.m stuck
View 2 Replies
View Related