Reputation: 29
Is there any way using Microsoft excel to do an equation that does something like this:
IF(Condition, If true, If false) <-- Just in case, this is how an if statement is formatted
IF(a cell in a range has a value other than zero, put that/those value(s) here, do nothing)
For example:
IF(B1:B13 is something other than 0, grab that value, do nothing)
Based on the table above and the "equation" I am trying to figure out, it would return 12 and 17, 15.
Let me know if I need to clarify anything.
Upvotes: 0
Views: 59
Reputation: 96773
If your version of Excel supportsTEXTJOIN()
,use:
=TEXTJOIN(",",TRUE,IF(B1:B13=0,"",B1:B13))
EDIT#1:
Some versions of Excel may require this formula to be array-entered.Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key. If this is done correctly, the formula will appear with curly braces around it in the Formula Bar.
Upvotes: 1
Reputation: 152585
If one has the Dynamic Array formula FILTER():
=FILTER(B2:B100,B2:B100<>0)
If not then put this in the first cell and copy down:
=IFERROR(INDEX(B:B,AGGREGATE(15,7,ROW($B$2:$B$100)/($B$2:$B$100<>0),ROW($ZZ1))),"")
Upvotes: 1