I have a excel formula which correctly returns true. But when I used the same formula in conditional format, I am not able to get the conditional format. Please help.
=AND(FIND("MyText",INDIRECT(ADDRESS(1,COLUMN()))),INDIRECT(ADDRESS(ROW()+2,COLUMN()))=1)
If the first cell of the column is "My-text" and the value is 1 (in row +2, same column) the formula correctly returns true. If I used it in a conditional format to paint a fore-ground color it is not working. I also tried search and searchb. But didnt work. The format of the cell (row() +2, column) that might have value 1 is "General"
If you change to R1C1 reference style, you can enter the formula as =AND(R1C="MyText", R[2]C=1)
R1 means row 1, C means same column, and R[2] means 2 rows below the current cell.
In A1 reference style, the formula will depend on the currently active cell, so if for example the active cell is A1, the formula will be =AND(A$1="MyText", A3=1)
Not sure why this wouldn't work. But you can simply replace the AND function with *. Here is what you can try:
=FIND("MyText",INDIRECT(ADDRESS(1,COLUMN())))*INDIRECT(ADDRESS(ROW()+2,COLUMN()))=1
I changed the AND into following and it worked. But not sure what is the issue with AND in conditional format
=NOT(ISERROR(SEARCH("MyText",INDIRECT(ADDRESS(1,COLUMN())))))
*INDIRECT(ADDRESS(ROW()+2,COLUMN()))
Added the above answer for reference.
Related
I'm trying to have one column change color (individual cells in that column, rather) depending on if there is text in a different cell in the same row. I've tried using something along the lines of =IF(($B1<>""), TRUE, FALSE) and that works, but when I try to copy that formatting to the rest of the column, the cell number that the formula references stays the same, so every cell in column A will reference cell B1 instead of changing the reference cell to B2, B3, etc... on down the column.
The problem with your formula i'm assuming is the $ sign which is an absolute reference. So if you use $B1 in your formula, you're saying that you need to always compare against the value in column B.
using this formula should probably work for you:
=IF(B1<>"", TRUE, FALSE)
But it also depends on the range that you're applying this conditional-format on.
TIP:
You don't even have to use the IF function, B1<>"" returns TRUE or FASLE by default.
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)
I have a formular for conditional formatting:
=VLOOKUP(H4;Anothersheet.A$4:$A$20;1;FALSE)=H4
When the value of H4 is found in the given range Anothersheet.A$4:$A$20, the cell gets colored in red. But I want to color the cell red if the value is not found. How can i achieve this?
I have tried the following formulars:
=VLOOKUP(H4;Anothersheet!$A$4:$A$20;1;FALSE)<>H4
=NOT(VLOOKUPH4;Anothersheet!$A$4:$A$20;1;FALSE)=H4)
But this doesn't work. In both cases the cell does not get colored (if the value exists in the given range and if the value does not exist in the given range).
User COUNTIF() for this:
=COUNTIF(Anothersheet!$A$4:$A$20,H4)=0
When not found your VLOOKUP() returns #N/A.
That being said, you can also edit your formula into:
=ISERROR(VLOOKUP(H4;Anothersheet!$A$4:$A$20;1;FALSE))
I have a cell that has the formula =INDIRECT(CHAR(COLUMN()+65)&ROW())*MONTH($A$1)/12 where INDIRECT references an integer and $A$1 is a date. For some reason, the MONTH part converts the entire cell into a date instead of a number. How do I change the formula to have it return a number in number format? (Manually changing each cell through the ribbon is not an option for me).
I haven't tested this (and I can't comment till I get 50 rep), but you could wrap the whole thing in a text formula, then multiply by 1:
=TEXT(INDIRECT(CHAR(COLUMN()+65)&ROW())*MONTH($A$1)/12,"#")*1
Hope this helps!
I have an if statement working properly in only one cell. =IF(B28="Others",+C28, 0). However, I also want to include the cells B28 to B30 and will add C28 to C30 respectively in the formula. How will I be able to do so? I have tried this formula: =IF(B28:B30="Others",+C28:C30, 0) but it won't work.
What I want to happen is this:
I will input values in the cells C28:C30, and if they're under a certain category (ex. B28 says 'Others'), that value will be added to that category above (ex. C18 for 'Others').
If it works, C18 should have a value of 1,450 since 1,150 and 300 are both under 'Others'.
The function you're looking for is SUMIF(). You can read about it here.
The complete formula you need is: =SUMIF(B28:B30,"Others",C28:C30)
you might want to use a sumif statement where you're summing on the values in C based on the category in B
http://www.exceltrick.com/formulas_macros/excel-sumif-and-sumifs/