Excel =CELL("color",[Cell]) Function - excel

I guess I'm a little confused by the CELL function within Excel. I'm using Excel 2010 and decided to try to figure out the CELL function as it pertains to the cells color. The documentation reads: The value 1 if the cell is formatted in color for negative values; otherwise returns 0 (zero). However, the image below is what has me confused.
The content in the C column are the formulas, and the content in the D column are the results from the formulas. I have tried so many different formatting options (including Conditional Formatting) on this simple test, but cannot get the value of =CELL("color",B1) to be anything but 0.
Any information on this would be much appreciated.

Documentation says:
The value 1 if the cell is formatted in color for negative values;
otherwise returns 0 (zero).
An example of a format that would generate a "1": Right click a cell -> Format Cells -> Select Number -> Choose the second format where the negative number appears in red.

Related

How to specify that 0 is not a null cell in Excel?

I'm trying to create a new rule in my Excel sheet where if a cell is equal to 0, then the cell is filled with a specefic color.
When I apply this rule, all the empty cells take on that color as well as the cells with the value 0.
I've been looking for an option in Excel to tell it that null cells != the value 0 but I can't find anything (I know that by default 0 = null).
My rule is "if cell value is" + "equal to" + "=0"
Thanks for helping me :)
Quick edit:
Here's a screenshot of the tool I'm using to create the rule :
Create rule with type 'Use a formula to determine which cells to format', add formula
=(A1=0)*(A1<>"")
(replace A1 with first cell's address of Applies to range), select desired range into Applies to field.
You would need to determine the formatting by a formula (the last item in the dialog of which you posted a picture) and then use this formula (or its French equivalent).
=AND(VALUE(A1)=0,ISBLANK(A1)=FALSE)
You colud first transform all your empty cells in empty string and then apply the format colour if it is equal to zero.
You can transform the empty cells with this formula:
=IF(A1="","",A1)

Excel Conditional Formatting Unexpected Result

The conditional format rule is set as an equation doesn't behave as I expect (highlight only values that are =1 in Column M corresponding to the current row). Instead they are seemingly randomly colored.
My code is as follows:
IF($M5=1,TRUE,FALSE)
where true results in the color green, false default formatting. This formatting is copied along a column, e.g. I also expect the value M$5 to correspond with the row in the cell with formatting in column M.
I observed that the color changes sometimes when Mrow=1, sometimes not.It appears uncorrelated with the row value. See below.
Item M-column Color
#1. 1 none
#2 0.48 green
#3. 0.0. green
#4 1. green
Any suggestions to understand what to try next to fix the probelm?
Thanks
Your formula is offsetting the row by 5, either use =$M1=1 or use the conditional formatting dropdown options to select highlight cells -> Equal to...
Based on the data provided it looks like your raw data has a 1 in rows 8,9,10, which is why it formatted the cells five rows above as green.
Also, you don't need to wrap your logical test in an IF() statement, it will return TRUE or FALSE either way.

Cell value displays as 1. Formula doesn't recognize value as one

I have a cell that is filled by the following formula:
=IF(AND((ISBLANK(E260)), (ISBLANK(G260)))=TRUE,"",(IF(ISBLANK(I260)=TRUE,"",SUM(K259,I260))))
This cell shows a value of one.
I am using the following conditional formatting to make this cell have bold text and green fill:=AND((ISBLANK(I10)),(K9=1)) (Those are the reference cells).
However, the formula doesn't recoginze the cell as being = to 1. It seems to act as if the cell is not equal to 1. I would be grateful if someone could explain what I am doing wrong. Relevant snapshots are below:
K259 = 0.997927296
I260 = 0.00207270
K259 + I260 = 0.999999996, not 1. You can show more decimal places to verify this. The number format or display is not the same as the underlying number.
You might consider adding a ROUND in your conditional formatting to get around this, if needed.

Excel: named range showing 0 even though the linked cell is empty

I am using the formula:
=(Cost!C8)
to get values from another sheet using named ranges. I want this to only show a value if there is a value in the corresponding cell of the other sheet, however, this formula returns a value of 0 even if the cell on the other sheet is empty. How can I make it so that the formula returns nothing (is blank) when the cell it refers to is empty?
Invoice
There are a number of ways to prevent zero's from showing when you refer to a blank cell.
The easiest if probably an IF statement. If your formula is:
=(Cost!C8)
...use:
=IF(Cost!C8="","",Cost!C8)
Similarly you could show a default value, or a label like <No Data> with a variation:
=IF(Cost!C8="","<No Data>",Cost!C8)
Note that Cost!C8 is not a Named Range; it's a cell reference, referring to another worksheet.
More Information:
Office Support : Create conditional formulas
TechRepublic : Three ways to hide zero values in an Excel sheet
Use,
=Cost!C8&""
'alternate for Qty
=TEXT(Cost!C8, "[<>0]0;;;")
'alternate for currency
=TEXT(Cost!C8, "[<>0]$ 0.00;;;")
'alternate for text items
=TEXT(Cost!C8, ";;;#")
Granted, this actually converts your true numbers to text-that-looks-like-a-number and that is generally a practice to be avoided but they will be converted back to true numbers through any maths operation like addition or multiplication.
A blank cell is considered numeric by nature. This can be tested with =ISNUMBER(<blank_cell>). The closest thing to a blank number is zero so you are returning those as the value of the blank cells you are linking to.
Use ISBLANK with IF
=IF(ISBLANK(Cost!C8),"",Cost!C8)
If you just want it to not be visible, you might consider using conditional formatting to make the text color white when the cell is equal to 0. This way the actual value remains 0 so it won't break downstream formulas.
A nice, slightly simpler, alternative is to concatenate the named range with an empty string.
=MyRange --> 0
=""&MyRange --> ""
This is equivalent to TEXT(MyRange) more concise than IF(ISBLANK(MyRange), "", MyRange)

Formatting Excel-Formula

I have made an excel formula that will take the data entered into column O and then multiply it by .04 and then input that data into column P. So I can calculate a four percent fee from the original number. I am now left with a bunch of $0.00 in every row in the P column that lacks data in the O column. I understand this is because 0*.04 = 0. But what I was wondering is if there was a way to make it so that if the total in column P was less than $0.01 or equivalent to $0.00 that the cell would remain blank.
I tried to post an image to show exactly what I am talking about, but I do not yet have the reputation. Hopefully you can understand what I am trying to do based off what I typed.
Do conditional formatting of the cell such that if the value = 0, the number type is "general"
Then, in your formula for the cell itself (assuming you multiply C3*B3), you can do this:
=IF(C3*B3>0,C3*B3,"")
This will use number formatting for all values that are non-zero, but empty string "" with general formatting for zero values.
Method 1:
Select the cells with the percentages in column P and tap Ctrl+1. When the Format Cells dialog opens, go to the Number tab and choose Custom from the list down the left. Supply the following in the Type: textbox.
$#,##0.00;;;
Click OK in the lower right.
Method 2:
Go into Excel Options (Alt+F,T) and choose Advanced from the list down the left. Scroll the right pane down to the Display options for this worksheet section and uncheck Show a zero in cells that have a zero value. Click OK in the lower right.
You can use conditional formatting when the value is less than 0.01 make the font white
The cell will still be 0 but not visible
Try this: =IF(O2<0.01,"",O2*0.04). This particular formula is checking to see if cell O2 is less than 0.01, and if so is filling in the P2 cell with a zero-length string. If O2 is equal or larger than 0.01 it will multiply by .04 and put that result in cell P2.

Resources