First of all, I realize that there are threads like this already, but I cannot get the examples I've seen to work. What I want to accomplish is that a cell value should be presented as "x,xx" and in red color if the value is higher than 0, and otherwise in Color 14.
For instance, if this formatting would be used on
0,05-0,03
It would return (in red):
0,02
What I have done is to format the cell as:
[Red][>0]0,##;[Color14][<=0]0,##;
but it prints out a minus sign for values less than or equal to 0, which I do not want. Changing to:
[Red][>0]0,##;[Color14][<=0]0.##;
Omits the minus sign, as I want, but it makes the cell red which is not intended.
I've also tried a numerous combinations of ",", "." and "#" but it just wont work as intended.
I hope anyone can shed some light into this.
EDIT Using "General" instead of "0,##" prints out many more decimals than desired.
EDIT2 I use a Swedish Excel and hence I translate the formulas to Swedish formulae. Perhaps of importance?
See: https://support.office.com/en-us/article/Create-or-delete-a-custom-number-format-78f2a361-936b-4c03-8772-09fab54be7f4
A number format can have up to four sections of code, separated by semicolons. These code sections define the format for positive numbers, negative numbers, zero values, and text, in that order.
<POSITIVE>;<NEGATIVE>;<ZERO>;<TEXT>
So for your requirement no [conditions] are needed.
[Red]0,##;[Color14]0,##;[Color14]0,##
will suffice.
As for your further descriptions
[Red]0,00;[Color14]0,00;[Color14]0,00
may be better.
You cannot change the value of the cell with formatting, only the appearance.
So if you want the cell value to actually be positive it is not possible to do this way.
If this is what you actually want to do, try =ABS(A1) (will have to be done in another cell)
Related
I have a column with specific case numbers, which look like 1/2017, 2/2017, etc. The series can go until infinite (I don't know for sure how many cases I will have), but it would be nice to be able to use autofill. If I select the first 3 values and drag down the fill handle, I get 1/2018, 2/2018, 3/2018. I would need exactly the opposite, to linearly change the first number and leave 2017 alone. The formatting of the column is General. Should I create a custom formatting and/or block the changing of the 2017 somehow? (I know that you can block a value of a cell from changing with the $ operator)
Thanks.
Put 1 in a cell and 2 in an adjacent cell. Use a custom number format of 0/\2\0\1\7 (which excel will auto-repair to 0/2\017). Fill as necessary.
Remember that you are now looking for 1, 2, etc in VLOOKUP's or any other cell comparison or matching.
This is an odd question. I have an issue I need to highlight a cell based on value, but it has a symbol in it and I cNt remove the symbol.
Value ranges are 1+ 3+ 5+ etc..
Need to highlight for each series higher than 1 but less than 3. Higher than 3 but less than 7. Etc...
Hope that makes sense.
Thanks
Casey
You should still be able to evaluate the number with the symbol after it, Excel should treat it as text where 1+ is still less than 3+ or 5+ is greather than 3+.
In your conditional formatting the rule would look something like this;
Cell Value <= $D$1
Where $D$1 is your selectable list which i'm assuming is possibly a validation list.
The format for the condition is whichever color you want it to highlight, and the Applies to part of the condition would be the range that you want to check against i.e. =$A:$A where all the 1+,3+,5+ numbers are.
This doesn't get you the whole answer but it should point you in the direction of setting your conditional formats.
I like Excel's color scale feature in the Conditional Formatting menu and I am trying to get it to work for text values.
The way it works for numerical values is that it color-codes the lowest and highest values each with a certain color and then any values in between form a gradient between the min and max colors.
I'd like to be able to do this with text based on the alphabetical order. So let's say I have a table of:
AT ANY BOY CAT
BAT CAT DAD AT
"ANY" would be the lowest value and "DAD" is the highest. I've applied the color scale to the table but none of the cells get colored. It seems like the values need to be numerical for a color scale to work. Is there a way to make this work? I'd rather not dive into any VB macros.
Using Excel 2010
JNevill's answer applies to a single letter but the same CODE function can be used multiple times with functions like MID or RIGHT to get unique numbers for each text value.
For example, if two text values are "Apple" and "Allure" in cells A3 and B3 you could use the following formulas:
=CODE(a3)
will get you 65
=CODE(b3)
will also get you 65 since you're asking for the ASCII of letter A both times so this won't work
=CODE(mid(a3,2,1))
will get you 112 since you're asking for the ASCII of the second letter ("P")
=CODE(mid(b3,2,1))
will get you 108 since you're asking for the ASCII of the second letter ("L") so this would work
You can concatenate the values of the first and second letters to get a longer, unique value:
=CODE(a3) & CODE(MID(a3,2,1))
will get you 65112
=CODE(b3) & CODE(MID(b3,2,1))
will get you 65108
Use however many combinations of the MID and RIGHT functions with CODE to get unique values that you can then apply color scales to.
NOTE: You'll have to convert any concatenated string into a number, so you can wrap the whole formula in =VALUE( xxxx ) and use the colour scales on that.
Be thoughtful of how complex the combinations need to be based on your text data set, because in the example of Apple and Allure, a combination of the first letters and last letters (you can get the last letters using the RIGHT function) would both be looking at A's and E's and therefore return the same number.
It's a bit of a workaround and not exactly what you are looking for, but in the next column (or row) you could use =Code(A1)... =Code(A2)... etc
This will get the ASCII character number for the character in each cell, which is a number. Then you could apply your conditional formatting to that.
Because of floating point values, I cannot add a string of cells that contain values such as:
0.08178502
0.09262585
0.13261762
0.13016377
0.12302067
0.1136332
0.12176183
0.11430552
0.09971409
0.125285
Even if I try adding the first two through a sum formula or auto sum through selecting them, excel spits out an error. I have googled this like crazy and tried to change number formats. Is there a function that can allow me to add this information ?
Screenshot:
The spreadsheet is available on my Dropbox.
Those numbers are all preceded by a NBSP (Char Code 160). So, in order to sum them, you have to remove that. Many solutions. Here's one:
=SUMPRODUCT(--SUBSTITUTE(A1:A18,CHAR(160),""))
If a formula like:
=A1+A2+A3+A4+A5+A6+A7+A8+A9+A10
produces:
#VALUE!
then your "numbers" cells contain non-visible characters.
They must be removed before the formula will work.
If the cells contain text strings and not actual values you will need to convert the text to numeric values before performing any calculations. The function "=value(cell)" will bring the numeric value.
e.g.: A1 contains "000.12345678" (or some other non-numeric presentation of numerals)
In cell B1 type: =value(a1)
Cell B1 now operates as the real number 0.12345678
Oddly enough, the fact that it said 0.xxxxx in all numbers vs. .xxxxx is what the issue was. I'm just sharing that for folks who google/search and have same issue.
All I had to do was select that whole row and do a search in replace for "0." and make it just "." and now my numbers were usable in equations. For some reason the adjustment of formating as many searches suggested wasn't working
I'm not sure why my VLOOKUP formula is not working like the screenshot below. The value is right there as highlighted. I want to output the value in Column G, but changing the 3rd parameter to 1 or 2 doesn't work.
Help is appreciated. Thanks much in advance.
Formula: =VLOOKUP(B2,$F$1:$G$421,2,FALSE)
One thing you may want to look at.
I notice your data is left justified and that's normally the case for textual rather than numeric fields - it's possible to left justify numerics but it's neither the default nor the general practice.
If they are textual, there's a chance one or more of them may have leading or trailing spaces. That would prevent the lookup from finding a match.
Select (in turn) B2 and F1 and use the arrow keys in the formula box to check this is not the case.
In cases like this, I tend to (temporarily) set B2 to the formula =F1 just to see if it can find a match that's guaranteed (then use CTRL-Z to revert).
If that change results in the lookup working then obviously the (original) B2 and F1 are not the same value, and you need to work out why (hidden spaces, wrong types, and so on).
It looks like you are comparing text to number (see the green triangle in your value cell). You have to convert the value in your source cell or matching cells to same type. To convert source to number use excel function such as int or value. Hope this helps.
Another way to convert text to number format is to multiply by 1 and then replace original text values with these new number values...
If you are doing lookup where you have a mix of text and numbers (i.e. looking up a text version of a number in a list of real numbers) you can also make use of the VALUE function... this will convert numbers stored as text to real numbers.
Embed it like so:
=VLOOKUP(VALUE(B2),$F$1:$G$421,1,FALSE)
If you have a mix of text numbers and text text to look up in numbers/text then you can do:
=VLOOKUP(IFERROR(VALUE(B2),B2),$F$1:$G$421,1,FALSE)
to change numbers stored as text to numbers, but leave other text as is...