Cell Contains Formula NOT blank - excel

i have a row with three cell each one contains formula and all formula result is blank, my question how can i use if formula to have the following result?
- in case all 3 cell blank ---> (0)
in case one or two cell have value (not blank) ---> (33)
Regards,

Use:
=IF(OR(LEN(A1:C1)>0),33,0)

Not 0 or Not ""?
A blank cell is a cell that doesn't contain anything. Since there is
a formula in those cells, you are probably asking if the value is 0
or "". Maybe both.
If you mean blank as in value 0:
If you will treat an error value as a value then use the following:
=IFERROR(IF(AND(A1=0,B1=0,C1=0),0,33),33)
Otherwise use the following:
=IFERROR(IF(AND(A1=0,B1=0,C1=0),0,33),0)
or e.g.
=IFERROR(IF(SUM(A1:C1)=0,0,33),0)
If you mean blank as in value "":
If you will treat an error value as a value then use the following
=IFERROR(IF(AND(A1="",B1="",C1=""),0,33),33)
Otherwise use the following:
=IFERROR(IF(AND(A1="",B1="",C1=""),0,33),0)
or e.g.
=IFERROR(IF(TEXTJOIN("",,A1:C1)="",0,33),0)
There are many other solutions

Related

If cell has zero entered, display zero. If cell has no value, display nothing [duplicate]

Suppose there is an empty excel sheet. Enter formula "=A1" into the B1 cell. The value of B1 would be 0.
My question is: why the value of B1 becomes zero when referring to an empty cell A1? Any rationales Excel behaves this way?
Thanks.
That is because the formula in B1 returns the value of cell A1.
Excel assigns the value 0 to a blank cell.
To distinguish 0 from blank, in B1 enter:
=IF(A1="","",A1)
FWIW, force a zero-length string with =A1&"". This can also be used to show (an apparently blank) cell when a VLOOKUP of INDEX/MATCH wants to return a zero after encountering a blank cell to return. Two caveats: first, a zero-length string is not truly blank and second, if used with VLOOKUP(...)&"" then any true number that should have been returned as a true number becomes text-that-looks-like-a-number. – Jeeped
Quoting the best answer so I can vote on it :)
I changed my application to =formula&"" according to Jeeped, and works great. Kinda dumb that Index returns Value(formula).

Formula to check cells and then perform sum action

In excel, i need to check the text value of 3 cells, A1, A10 & A20 if either contains a text string CK75 then i need to add together values in cells B1, B10 & B20 and put the answer in Cell B2.
I started with an OR statement but i can only check 2 cells
=OR(B25="CK75 -Al",B27="CK75- Al")
=OR(B25="CK75 -Al",B27="CK75- Al")
I also tried this which works in part
=IF(ISNUMBER(SEARCH("CK75 - ",A20)),SUM(B1+B20),B1)
This will do it and return blank if the condition is not met:
=IF(OR(A1="CK75",A10="CK75",A20="CK75"),SUM(B1,B10,B20),"")
From the first line of your question (and your second attempt) it appears as though the text string in these cells can contain the substring, rather than exactly be the searchvalue CK75. If that is the case you could do as follow:
The formula I used translates to:
=IF(ISNUMBER(FIND("CK75",A1&A10&A20,1)),SUM(B10,B1,B20),"")
FIND() will trigger on capital/non-capital. If you dont want that to happen you should replace that with SEARCH()

Excel formula unique list formula not working, if counta = 1

I have the following formula to make a unique list from column plant in table 15:
{=IFERROR(INDEX(Tabel15[Plant];MATCH(0;COUNTIF(Analyses!$Q$2:$Q2;Tabel15[Plant]);0));"")}
This formula is working, but when there is just 1 value in column plant the formula gives a value of 0. This is wrong because it should return the value.
Does anyone know how I can adapt this formula to make it work?
I wanted to change it to this:
{=IF(COUNTA(Tabel15[plant])>0;INDEX(Tabel15[Plant];MATCH(0;COUNTIF(Analyses!$Q$2:$Q2;Tabel15[Plant]);0));Kopie - datablad$G$2)}
But it doesn't work either.
Good mock example. Try and see if this works:
The formula counts the unique cells against another list. The unique list expects to take the first row, no matter what. It also expects you to have more than one value in your duplicate list. If it doesn't you can't compare since it expect duplicates and it throws an error, #N/A. This is mask as blank cell since it's wrapped in IFERROR:
"Unique formula" = IFERROR(INDEX(Tabel15[Plant],MATCH(0,COUNTIF($Q$1:Q2,Tabel15[Plant]), 0)),"")
To solve this we check how many values it exist in our duplicate list:
=IF(COUNTA(Tabel15[Plant])>1,... "Unique formula" ... ,Tabel15[Plant]) //***//
This will give us this result.
Then you probably don't want duplicates...
So we need to check if previous rows contain any of the values the formula would return.
The VLOOKUP formula do that for us, and as lookup value we use the formula above //***// and lookup range will be our current column: $Q$1:Q2. NOTICE this is a dynamic range so Q2 is relative reference (no $).
=IF(ISERROR(VLOOKUP(IF(COUNTA(Tabel15[Plant])>1,IFERROR(INDEX(Tabel15[Plant],MATCH(0,COUNTIF($Q$1:Q2,Tabel15[Plant]), 0)),""),Tabel15[Plant]),$Q$1:Q2,1,FALSE))
So the Final result we need to apply is this in Cell Q3:
=IF(ISERROR(VLOOKUP(IF(COUNTA(Tabel15[Plant])>1,IFERROR(INDEX(Tabel15[Plant],MATCH(0,COUNTIF(Analyses!$Q$1:Q2,Tabel15[Plant]), 0)),""),Tabel15[Plant]),Analyses!$Q$1:Q2,1,FALSE)),IF(COUNTA(Tabel15[Plant])>1,IFERROR(INDEX(Tabel15[Plant],MATCH(0,COUNTIF(Analyses!$Q$1:Q2,Tabel15[Plant]), 0)),""),Tabel15[Plant]),"")
The macro error can be ignored by:
If Not IsError(Sheets("Hulpblad").Range("B6").Value) Then
t = Sheets("Hulpblad").Range("B6").Value
'Code...
End If
there is no problem in your formula, it is just telling that there are blanks in the range, 0 means blank. the formula is treating the blank as a value and also considering it in the unique value calculations.
If you want to remove 0 you can just insert an if over your formula to remove it. like
=if(formula = 0, "", formula)
or in orignal form
=IF( (IFERROR(INDEX(Tabel15[Plant],MATCH(0,COUNTIF(Analyses!$Q$2:$Q2,Tabel15[Plant]),0)),""))=0,"",IFERROR(INDEX(Tabel15[Plant],MATCH(0,COUNTIF(Analyses!$Q$2:$Q2,Tabel15[Plant]),0)),""))
or go in the cell formatting and change the format to display 0 as a dash.
sometimes blank is also used as error checking, you can apply such formulae as well to check how many are blank, maybe that would someday be used to check any data entry problems.

Use formula to sum cells which is reference of another cell

Use formula to sum cells which is reference of another cell
My requirement:
Note: Inside bracket is the formula that particular cell holds
A1(=Sheet1!A1) ==> 6
A2(=Sheet1A2) ==> 2
A3(=Sheet1!A3) ==> 2
A4 (=SUM(A1:A3)) ==> 0 (is what I am getting) but I need A4=10
Help me out with this.
As mentioned by #Scott, one of your cells probably contains a number stored as text.
To check try either selecting all the cells and setting the format or troubleshoot which cell(s) is(are) causing the problem.
=SUM(VALUE(A1),VALUE(A2),VALUE(A3))
This will convert each cell to a numeric value. If that works then start swapping out the value function for just the cell reference (e.g. -Value(A1) becomes simply A1) and see which cell breaks the sum function. Once you find that cell you can wrap whatever formula is in that cell in the value function to force it to store the numeric value.

IFERROR Vlookup outputs 0, How to avoid this

=IFERROR(VLOOKUP(AS:AS,'Data'!B:G,6,FALSE),"")
This formula outputs value 0 when there is no item to vlookup in column AS:AS, How do I avoid the 0, to output only blank?
Try passing in NA if the cell value be missing:
=IFERROR(VLOOKUP(IF(AS:AS="",NA(),AS:AS),'Data'!B:G,6,FALSE),"")
The idea here is that empty cells would pass #N/A to VLOOKUP thereby causing an error, and causing the error message to print (in your case you have chosen empty string).
A formula will always output 0 from a blank cell.
You can fix it by:
Use cell formatting such as 0;-0;;#
Use =T(...) if you're expecting text
I'd advise you to use a single cell as a lookup value and the specific range for your lookup array so that there's no possibility of the formula returning zero unless that's a valid result from your table, e.g. in row 2 copied down if required
=IFERROR(VLOOKUP(AS2,'Data'!B$2:G$100,6,FALSE),"")

Resources