Reputation: 65
I would like Excel to execute the following formula ONLY if B2 has a value in it. How do I write that into this formula?
=IF( ISNUMBER( MATCH( MATCH(A2,AllResources4[Title],0), SUBTOTAL(3,OFFSET(AllResources4[[#Headers],[Title]], ROW(AllResources4[Title]) - ROW(AllResources4[[#Headers],[Title]]),))*(ROW(AllResources4[Title]) - ROW(AllResources4[[#Headers],[Title]])),0)), VLOOKUP(A2,AllResources4[#All],8,0),"")
I want Excel to look for A2 in the "AllResources4" table or return the result only if its corresponding B2 cell has a value. Same with A3, A4, etc.
Upvotes: 1
Views: 88
Reputation: 37
Using ISBLANK is the way to go. However, I sometimes get sketched out since you can't see how ISBLANK is actually working. That being said, it sometimes it worth inserting a column next to your data dedicated to the ISBLANK function. Something like:
=IF(ISBLANK(cell),0,1)
Then, you can check to make sure that the function works and use sort/filter to get the cells that you need to use the function on. Of course, if you want the function applied to all the data but only to work on the non-blank cells, you could add a clause to the IF for whether the column value we jsut made is one or zero.
NOTE* if you are working with numbers, the count function might also be helpful
Upvotes: 2
Reputation: 73
=IF(ISBLANK(B2),Formula,"")
The ISBLANK function will check if a cell is blank (has no value), combined with a if statement will run your formula only when B2 has something in it. The above formula will output nothing if B2 is blank.
Upvotes: 1