Hide #NA displayed in the cell by formula =IFERROR(~~~,NA()) - excel

I'm trying to format my excel sheet and to display organized chart, I have to do( A1~A100 )
IFERROR($B1+$C1,NA())
To make cells #NA value instead of
IFERROR($B1+$C1,"")
IFERROR($B1+$C1,"-")
because those "" or "-" is going to be shown as 0 value on chart and it looks really bad on sight.
But I don't want #NA to be shown on my cells. It's clearly makes my sheet looks messy.
I tried to do Conditional Formatting to do
'New Rule...'→'Use a formula to determine which cells to format'→=ISNA(A1)→white blank
It worked but since the rule only applies only when "A1" is not #NA and not to others, I don't think this is a practical solution.

Try this in your formatting =ISNA($A1) then drag down copy the cell after clicking apply.

I don't see any other choice than using range1 (your current range) for calc and as chart source, then create range2 pointing to range1 using IFERROR, then finally hiding range1.
A bit clumsy, but that's the only way I see here to separate data from presentation.

Related

Office 360 Excel formula with output to separate cell. No code

Sorry if this is a old question, I have a requirement to have a value pushed from a cell on one sheet to another cell on anaother sheet, without setting the destination cell.
So: 'Sheet1!A1' has formula, 'Sheet2!A2' is where I would like the output to end up without setting the cell with ='Sheet!A1' or using VBA, otherwise we would not be here right now.
It seems like a simple ask the beginning but I'm stumped
The cell in the other sheet cannot have the answer and also be blank. You can, however, set the colour of the text to be the same as the background.

AND / INDIRECT Conditional Formatting

What I am trying to achieve is if a cell in column AB equals "Yes" and a cell in column AC is blank, then a certain range of cells will be formatted. Currently the rule is not formatting cells that it should. I am basing this code on another formatting rule I am using that works properly, but does not use AND().
=AND(INDIRECT("ab"&ROW())="Yes", INDIRECT("ac"&ROW())="")
I am sure this is an obvious syntax mistake, but I am still very new to Excel and can't figure out why this isn't working.
Try This:
=AND($AB1="YES",$AC1="")
Use the format painter to drag the formula around.
As Jeeped said, change the 1 in $AB1 and $AC1 to your first row.

Excel Formula If Cell Contains String

I'm currently working in excel, and I'm trying to figure out a way to find if multiple cells contain the string value of another cell, and if it does highlight the cell where the row and column meet up. I created an example of what I want, only it will be on a much larger scale.
I've tried using: =ISNUMBER(SEARCH(substring,text)) but I'm not quite sure how to use it the way I want to.
Any help will be appreciated!
Your approach is correct, we can use the fact that conditional formatting is applied like dragging a formula, adapting relative references.
Create a conditional formatting formula rule:
=ISNUMBER(SEARCH(B$1,$A2))
Applied to B2:D7
Your formula will work nicely; what you'll want to do is put that formula into all the cells you want to highlight, so you get FALSE and TRUE in every cell.
You'll then use two Conditional Formatting rules. The first will look for Cell Value = TRUE, and will set cell background and font colour to yellow. The second will look for Cell Value = FALSE, and will set cell background to No Colour and Font to White.
This will reproduce the result you're looking for.
Edited to add:
It is possible to do this using just Conditional Formatting too, but it's a little more fiddly. If you want to try it, you can do this:
Highlight your range, and take note of which cell is Active - that's the cell within your highlighted range that is still white. It's also the one whose address is shown in the Name box in the upper left. For the sake of this answer, we'll assume that's B2
Create a new Conditional Formatting rule. Choose "Use a formula to determine which cells to format".
Use the formula =ISNUMBER(SEARCH(B$1,$A2). Set the format to colour just the cell background.
Note where the $ appears in the formula above - you want to leave the row number anchored in the first part, and the column letter anchored in the second part.
This takes advantage of the fact that Conditional Formatting is able to use absolute, relative, and mixed references to find which cells to format. It's also a tidier solution, but it can be harder to maintain if the sheet is ever repurposed or modified.

Formatting an adjacent cell based on the content of another cell

I believe this is probably an easy macro; it does not appear to be possible with conditional formatting and I have limited experience with macros.
I have many rows in an Excel workbook. What I'd like to is say:
If I place a < sign in the currently selected cell, then cell immediately to the right should format as bold, otherwise, it should not be emboldened.
I have fooled around with different "IF" statements, but I think I'm way off base.
How in the world do I do this?
EDIT
Here is perhaps a better way to show this, because for some reason I still cannot get it to work; I've included a screenshot.
(Actually, I realized that I asked the question backwards...it should be that if there if there is a cell with a "<" sign then the cell immediately to the right should not be bold).
Anyways, let's focus on row 12 for the sake of an example. It would be nice to have a formula to apply to the entire row that says "look at cell C12. If there is nothing in it, then D12 is emboldened. Look at cell E12, if there is nothing in it then F12 should be emboldened, etc. Look at cell Q12. If it has a "<" sign, then R12 should not be emboldened". The only exception to this would be cells that contain a "--"...those do not need to be emboldened.
With CF, select the range of cells to apply the formatting to - say Columns B:M (not A because that has no "immediately to the left") - HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=A1="<"
Format..., select Bold, OK, OK.
Edit By "those do not need to be emboldened" I take it you don't mind if they are. That might allow you to embolden the entire sheet (or rather ColumnsC:X) and apply a single conditional format. However that would result in the < themselves being emboldened and I take it you would prefer not. So if formatting is to be applied according to two separate conditions two separate rules are required. Select Columns D:X and for *bold**:
=C1=""
For Regular, with the same range selection:
=C1="<"
You're right, it is an easy macro. And #Scott Craner is correct as well; conditional formatting will work. However, there are times when you already have a lot of conditional formatting and adding another rule becomes a bit tricky, so here is the macro. Put it in the ThisWorkbook section.
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Value = "<" Then
Sh.Cells(Target.Row, Target.Column + 1).Font.Bold = True
End If
End Sub
As you can see, you can make your own little formatting rules by checking the value of the cell that changed.
To learn more, search up "Learn Excel". Plenty of resources.

Checking cell value dynamically

What I'm doing is a simple map on one tab of an office space that has all the cubicals laid out. On this map, I have conditional formatting checking another table of listen computers for the last time they were updated/maintained. It works as it stands, but we are moving into a new building and the map (which is already done) has WAY more cubes than last time. So I'm trying to figure out a more efficient way to do this task.
Here is the code:
=AND(VLOOKUP("CCA C1",LOCATION,3,FALSE)<>"",VLOOKUP("CCA C1",LOCATION,3,FALSE)<TODAY()-80)
So as it sits, it works fine. But what I'm trying to do is change the "CCA C1" to simply read the contents of the cell it's formatting so I can just format an entire range of cells rather than doing it cell by cell. The "CCA C1" is in the location of the second sheet (it's a named range). So this checks that entire range for "CCA C1" and checks if the date a couple columns over in that row is within 80 days, if it's not it highlights the cell in the map in red reminding us we need to check the computer. But what I would like to do is simply put "CCA C1" in the cell in the map (which is already is labeled), and have this check for the value of the cell it's formatting and look for that value the same way it's looking now. Just without me having to put "CCA C1" in the formula, I'd like to say something like this:
=AND(VLOOKUP(CURRENT CELL VALUE,LOCATION,3,FALSE)<>"",VLOOKUP(CURRENT CELL VALUE,LOCATION,3,FALSE)<TODAY()-80)
Make sense? Anyone know of a way to do this? Otherwise I have to conditionally format each individual cell with the value manually rather than just format all the cells with the same formatting and have the formula check the contents of the cell for what to look for in the location range of the other sheet.
And to clarify, I know that I can put in the actual cell, such as E3, but then I still have to manually change the formula for each cell which defeats the purpose. I want to just say current cell or something like that. I have 3 conditional formats for each cell, I have around 100 cells to be formatted, so rather than having 300 formats I have to put in, I'd love to just do 3. Not sure if this is possible, that's why I'm asking :)
Just replace "CCA C1" with the address of the first cell in the range of cells with the conditional formatting. Assuming your conditional formatting starts in B2:
=AND(VLOOKUP(B2,LOCATION,3,FALSE)<>"",VLOOKUP("CCA C1",LOCATION,3,FALSE)<TODAY()-80)
EDIT: As I commented, I'm not sure I understand the issue, but if I do, you need to enter the range of cells with CF in the applies to range of the CF dialog, rather than copying and using Paste Special:
Note that this works with the merged cells.
You will need to adjust the applies to range as you add more computers, etc., but the same formula will work.

Resources