Home > Software design >  Copying data from cells in column A to C on Google sheets
Copying data from cells in column A to C on Google sheets

Time:09-21

To copy data from column A to column C

If Cell A empty, to take data from column B

If both cell empty mention Nil

Google Sheetlink - enter image description here

I have tried

=ARRAYFORMULA(IF(A2="",A2,B2))

The results are incorrect

CodePudding user response:

Use MAP to get each value, IFS to check if empty and return appropriate values:

=MAP(A2:A15,B2:B15,LAMBDA(a,b,IFS(a<>"",a,b<>"",b,true,"Nil")))

Advantage: You only need to enter the range once.

CodePudding user response:

try:

=INDEX(IF(A2:A10="", IF(B2:B10="", "Nil", B2:B10), A2:A10))

enter image description here

advantage: it's simple

  • Related