If Then Shortcut

Occasional Visitor

Hi, I'm trying have a cell look about 100 cells on a particular row (with formulas) for the first cell that has a number greater than 0 (zero) and then look and then look at another row of 100 cells for a corresponding date. Is there a way to write a shortcut formula without having to write the normal =if(a1>0,c1,If(a2>0,c2 etc etc etc...))?


I tried to do this 


but it did not work and it came back with a #SPILL! error.



2 Replies



You can try this formula. Enter the formula with ctrl+shift+enter if you don't work with Office365 or 2021.

index and small.JPG 

@GreggBfree The spill error indicates the formula is returning an array of multiple values and it's trying to place each value in a new column.  Somewhere to the right of your formula, there is data or text in a cell that is within the range of the returned array.  


You can highlight the formula in the formula bar and press F9 in order to see what it's returning.  Then either escape or undo so that the formula remains instead of the static value it returned.  You will likely see it is returning a date for every instance instead of only the first.  


Try this for the first instance: