Input

1   0
7   77
6   66


Expected Output

7   66


= arrayformula(if(B2:C2,B3:C3,B4:C4))


How to do that in Excel?

-
 And what is the question? Did you consult the manual? – mpiktas Oct 17 '11 at 11:40 Clarified question, trying to get the thing in Google Spreadsheet to work in Excel. – hhh Oct 17 '11 at 11:45 It is still NOT clear because you haven't written what this code is supposed to do; the easiest way to get 7 66 is just to write it ;-) – mbq♦ Oct 17 '11 at 11:59 @mbq: thanks, good fix. – hhh Oct 17 '11 at 12:03

$$\begin{array}{c|r|r} & \mbox{B} & \mbox{C} \\ \hline 2 & 1 & 0 \\ 3 & 7 & 77 \\ 4 & 6 & 66 \\ \end{array}$$
For a given column, the if condition (if(B2:C2,B3:C3,B4:C4)) means: if the value in row 2 is true (or 1) then return the value at row 3 else return the value at row 4.
You can achieve this in Excel by typing (in B6, for example) =IF(B2,B3,B4), selecting B6:C6 and using "Fill right" (or by dragging the fill handle at the bottom right corner of the initial cell when expanding the selection).