I'm trying to build a simple formula: if the cell on the same row as current cell, but column J is either =1 or empty, then the result is 1, else 0.
The part about =1 works, the part about="" does not for some reason.
Here is my formula:
=IF(OR("J"&ROW()=1,"J"&ROW()=""),1,0)
Can anyone help me find out why "J"&ROW()="" returns false, even if it is clearly true? The "J"&ROW()=1 returns true if the target cell is 1.
Another thing i tested is "J"&ROW()=j50, where 50 is the actual row number, and this also returned false, which does not make any sense to me.
You need either INDIRECT to turn the string into a cell reference
=IF(OR(INDIRECT("J"&ROW())=1,INDIRECT("J"&ROW())=""),1,0)
or use INDEX (as INDIRECT is volatile)
=IF(OR(INDEX(J:J,ROW())=1,INDEX(J:J,ROW())=""),1,0)
In this specific case it makes sense to make use of RC notation. A formula would look like this:
=IF(OR(RC10=1;RC10="");1;0)
I have an Excel formula that sums something if 2 conditions are TRUE:
=SUMIFS(F:F,$A:$A,$A71,$M:$M,$M71)
What I was looking for, is actually changing one of those conditions to check if its FALSE, so:
Scenario:
When it finds all records with different value in A and same value in M
How can I do it?
Thank you for help
Try,
=SUMIFS(F:F, $A:$A, "<>"&$A71, $M:$M, $M71)
I have a VLOOKUP formula which needs to return true or false depending on certain conditions in another worksheet Sheet2.
In Sheet2, a cell can either be blank, contain a zero or a number.
My formula needs to return TRUE if the cell has a number or is blank, and FALSE if the cell contains a zero. I thought the following formula would work, but it's assuming zero is blank and so returns false for both zero and blank cells.
VLOOKUP(C2,Sheet2!$A$2:$J$100,10, FALSE)<>0
I can solve this by using an OR statement, like this:
OR(VLOOKUP(C2,Sheet2!$A$2:$J$100,10, FALSE)<>0,
VLOOKUP(C2,Sheet2!$A$2:$J$100,10, FALSE)= "")
But I want to know if there is a way of doing this which does not require writing out the whole VLOOKUP formula twice. In other words, is there a way to simplify this?
Appreciate the help!
=NOT(LEFT(VLOOKUP(C2,Sheet2!$A$2:$J$100,10, FALSE),8192)="0")
Just compares the left 8192 char of the text string match to "0" and inverts. Although it would work with any number greater than 1, I chose 8192 is because that is the max cell length allowed in excel. Bonus :P
This seems to work:
=IFERROR(--(""&VLOOKUP(C2,Sheet2!$A$2:$J$100,10, FALSE)),1)<>0
I'm at my wits end trying to troubleshoot COUNTIF
I see there are three instances of 11.0.6000.0162 but =COUNTIF(A1:A8559,B1) doesn't believe this.
And I evaluated the cells
=A1=B7 = TRUE
=A2=B7 = TRUE
=A5=B7 = TRUE
I have been trying to run larger figures and now I know why the numbers don't quite add up .... Thanks!
UPDATE
Here is new set of data. I thought =COUNTIF($A$1:$A$20,B1) would work, but I'm still having problems
Assuming column A contains all your data, B contains the certain numbers you wish to count and C1 is where you will post the formula
=COUNTIF(A:A,B1)
will work if you write the number in B1 in exactly the same format as it would be in the list.
You could then drag the formula down from C1 as far as needed.
I would like to write an IF statement, where the cell is left blank if the condition is FALSE.
Note that, if the following formula is entered in C1 (for which the condition is false) for example:
=IF(A1=1,B1,"")
and if C1 is tested for being blank or not using =ISBLANK(C1), this would return FALSE, even if C1 seems to be blank. This means that the =IF(A1=1,B1,"") formula does not technically leave the cells blank if the condition is not met.
Any thoughts as to a way of achieving that? Thanks,
Unfortunately, there is no formula way to result in a truly blank cell, "" is the best formulas can offer.
I dislike ISBLANK because it will not see cells that only have "" as blanks. Instead I prefer COUNTBLANK, which will count "" as blank, so basically =COUNTBLANK(C1)>0 means that C1 is blank or has "".
If you need to remove blank cells in a column, I would recommend filtering on the column for blanks, then selecting the resulting cells and pressing Del. After which you can remove the filter.
Try this instead
=IF(ISBLANK(C1),TRUE,(TRIM(C1)=""))
This will return true for cells that are either truly blank, or contain nothing but white space.
See this post for a few other options.
edit
To reflect the comments and what you ended up doing: Instead of evaluating to "" enter another value such as 'deleteme' and then search for 'deleteme' instead of blanks.
=IF(ISBLANK(C1),TRUE,(TRIM(C1)="deleteme"))
I wanted to add that there is another possibility - to use the function na().
e.g. =if(a2 = 5,"good",na());
This will fill the cell with #N/A and if you chart the column, the data won't be graphed. I know it isn't "blank" as such, but it's another possibility if you have blank strings in your data and "" is a valid option.
Also, count(a:a) will not count cells which have been set to n/a by doing this.
If you want to use a phenomenical (with a formula in it) blank cell to make an arithmetic/mathematical operation, all you have to do is use this formula:
=N(C1)
assuming C1 is a "blank" cell
You could try this.
=IF(A1=1,B1,TRIM(" "))
If you put this formula in cell C1, then you could test if this cell is blank in another cells
=ISBLANK(C1)
You should see TRUE. I've tried on Microsoft Excel 2013.
Hope this helps.
I've found this workaround seems to do the trick:
Modify your original formula:
=IF(A1=1,B1,"filler")
Then select the column, search and replace "filler" with nothing. The cells you want to be blank/empty are actually empty and if you test with "ISBLANK" it will return TRUE. Not the most elegant, but it's quick and it works.
The easiest solution is to use conditional formatting if the IF Statement comes back false to change the font of the results cell to whatever color background is. Yes, technically the cell isn't blank, but you won't be able to see it's contents.
This shall work (modification on above, workaround, not formula)
Modify your original formula:
=IF(A1=1,B1,"filler")
Put filter on spreadsheet, choose only "filler" in column B, highlight all the cells with "filler" in them, hit delete, remove filter
You can do something like this to show blank space:
=IF(AND((E2-D2)>0)=TRUE,E2-D2," ")
Inside if before first comma is condition then result and return value if true and last in value as blank if condition is false
The formula in C1
=IF(A1=1,B1,"")
is either giving an answer of "" (which isn't treated as blank) or the contents of B1.
If you want the formula in D1 to show TRUE if C1 is "" and FALSE if C1 has something else in then use the formula
=IF(C2="",TRUE,FALSE)
instead of ISBLANK
Here is what I do
=IF(OR(ISBLANK(AH38),AH38=""),"",IF(AI38=0,0,AH38/AI38))
Use the OR condition OR(ISBLANK(cell), cell="")
I think all you need to do is to set the value of NOT TRUE condition to make it show any error then you filter the errors with IFNA().
Here is what your formula should look like =ifna(IF(A1=1,B1,NA()))
Here is a sheet that returns blanks from if condition :
https://docs.google.com/spreadsheets/d/15kWd7oPWQmGgYD_PLz9YpIldwnKWoXPHtHQAT3ulqVc/edit?usp=sharing
Nope ... that only works for Googlesheets ... not Excel.
To Validate data in column A for Blanks
Step 1: Step 1: B1=isblank(A1)
Step 2: Drag the formula for the entire column say B1:B100; This returns Ture or False from B1 to B100 depending on the data in column A
Step 3: CTRL+A (Selct all), CTRL+C (Copy All) , CRTL+V (Paste all as values)
Step4: Ctrl+F ; Find and replace function Find "False", Replace "leave this blank field" ; Find and Replace ALL
There you go Dude!
Instead of using "", use 0. Then use conditional formating to color 0 to the backgrounds color, so that it appears blank.
Since blank cells and 0 will have the same behavior in most situations, this may solve the issue.
This should should work: =IF(A1=1, B1)
The 3rd argument stating the value of the cell if the condition is not met is optional.