VBA - Conditional Formatting with tick mark and x mark - vba

So, I am trying to use these symbols from conditional formatting, but I only need the red x and green tick mark. Is there a way to use only those two with conditional formatting and apply it within my code.
For those that have answered this is what my screen looks like.
Thanks

Depending on what you are applying you conditional formatting you could just set both to green then the last one to red as the picture show, when the number is greater equal than 0 is green else red. ( It's the italian excel version but i think that you can understand what i did)

See this:
Note the comparison operators with values. For Yellow select > instead of >=.

Go to CF menu.
Manage Rules
Edit Rule
Select ! and pick "No cell icon"

Related

Conditional formating in word document

I am distributing some variables from excel to word. Now, I would like to put a conditional formatting in some fields. The normal situation that is working fine is this field:
{DOCVARIABLE AB*MERGEFORMAT}
Now, I want to apply condition to AB. For example, if AB < 1 it is highlighted as green and if it is AB>1 it highlighted as red. I tried different variations, but all of them was wrong. For example, 2 of them are these:
1- {If {DOCVARIABLE AB*MERGEFORMAT}> "1" {DOCVARIABLE AB*MERGEFORMAT} {DOCVARIABLE AB*MERGEFORMAT}}
2- {If <<DOCVARIABLE AB*MERGEFORMAT>> > "1" {DOCVARIABLE AB*MERGEFORMAT} {DOCVARIABLE AB*MERGEFORMAT}}
And I am highlighting the middle part as red and the last part as green. But it gives me the error that the operation is unknown, so the if function is not written in a proper way.
Although conditional formatting does not exist in Word it is possible to approximate it for very simple conditions. For further information see the documentation for IF field

Swapping the placement of a character in a cell

I've been looking for a way to change the placement of a character within a cell with a macro, and have not been able to find exactly what I'm looking for. I've found ways to switch words (such as first name last name), but I need to switch a single character that is attached to the end of a number.
The report that's being filtered in registers negative numbers as:
2.00-
and I'm looking for an easy way to switch it to:
-2.00
as I am dealing with a massive number of records. Is there an easy macro that I can use to do this, or do I need to manually change these? Thanks in advance!
Select column then Text-to-Columns, Fixed width, Next, Advanced, Trailing minus for negative numbers, Ok, Finish.
With data in A1, in B1 enter:
=IF(RIGHT(A1,1)="-",-MID(A1,1,LEN(A1)-1),A1)
Create a new column and insert this formula. Replace A3 with the first cell in question, and then drag it down:
=IF(RIGHT(A3,1) = "-", LEFT(A3, LEN(A3)-1) * -1, A3)

Conditional Format Based on color code

I need to conditional format background color of Columns O:Y based on the color code AF:AK, is there a conditional format formula, or VBA code I can use.
Please ignore current format on columns O:X
You can't set the background colour to match the numbers directly in those cells with conditional formatting, though it is possible using VBA.
However, it is easier to check the value of the cells using the standard Conditional formatting rules and set the colours manually. This means you can have any colour matched to any number. Of course, you can choose the correct colour to fill if this is important to the solution.
I have set this up on a sheet below. I put the conditional formatting formula in the first cell (removing the $ symbol the system puts in for you) and copy across and down.

Change #N/A to Blank cell

How can I change the #N/A to the blank cell if nothing in that cell?
Eg. =VLOOKUP(B19:B36;$TABLE.A1:C46;2;0)
I think I might need something like an ISERROR check but I don't 100% know what I'm doing.
If we're talking about Excel 2010 and later you can use IFERROR:
=IFERROR(VLOOKUP(B19:B36;$TABLE.A1:C46;2;0);"")
You can also put text into the final string result
The question was misleading about the spreadsheet software as 2 different spreadsheets were originally stated in tags. However, it can be seen that the question is about OpenOffice Calc:
- Absolute sheet referencing ($ sign before the sheet name) is not possible in Excel.
- We also see a dot between the sheet name and the range, which is again not possible in Excel.
As in OpenOffice Calc you don't have IFERROR function, the only way is to repeat your main function twice in the following form (you can use both, ISNA and ISERROR, but I suggest ISNA as it's more specific and fits your case):
=IF(ISNA(YourFormula);"";YourFormula)
In your case something like:
=IF(ISNA(VLOOKUP(B19;$TABLE.A1:C46;2;0));"";VLOOKUP(B19;$TABLE.A1:C46;2;0))
You may want to make absolute reference to the range where you look for matching values, as I see you want to copy the formula down.
=IF(ISNA(VLOOKUP(B19;$TABLE.$A$1:$C$46;2;0));"";VLOOKUP(B19;$TABLE.$A$1:$C$46;2;0))
Since the cells will contain a formula this is about appearances, so Conditional formatting might suit, say if the cell background is white, for style choose Font > Font Effects > Font color white.
For this, select the relevant range - I have assumed D19:D36 - and Format > Conditional Formatting... and for Condition 1 choose Cell value is and equal to and:
ISNA(D19)

Assigning a background color to a cell, given a condition on another cell

I am trying to create a formula in Microsoft Excel 2010 to accomplish the following algorithm:
If A1=10, then A2 has a background color of red.
I have basic knowledge of if/then statements in Excel, so I have this so far:
=IF(A1=10, x)
...where x would be the formula for changing the background color of the cell. However, after conducting some internet research on the subject, the consensus seems to be that I should instead use conditional formatting to accomplish this task. I have never used conditional formatting and am having trouble understanding how to utilize it so that a condition on one cell would affect another cell.
This is the conditional formatting screen that I am faced with:
So I guess I have two questions:
Is using conditional formatting the best way to accomplish this?
If so, how can I utilize it to assign a background color to a cell, given the truth of a condition on a different cell?
You can do it using conditional formatting, so you're on the right track. One thing I'm assuming here is that you want to format the cell to the right of the cell with the value - is that correct? If so, you actually don't need to use an if formula (though your logic is correct). In that dialog box, make the formula:
=A1=10
And then when you click OK, change the Applies to range by clicking on the little chart icon next to it and clicking cell B1. Then do apply, etc., close out the box and try typing 10 in A1. When you need to expand the range, you can just change that Applies to range to encompass everything you want affected. In the example below, cells B1:B26 will all change if 10 is entered in the cell directly to the left (column A).