Maximus
Maximus

Reputation: 29

Copying data from cells in column A to C on Google sheets

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 - https://docs.google.com/spreadsheets/d/19M0DlaRY_JgcgyyG2GpGhuEpdqMiDX-y2YoTA0TIakQ/edit?usp=sharing

enter image description here

I have tried

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

The results are incorrect

Upvotes: 0

Views: 44

Answers (2)

player0
player0

Reputation: 1

try:

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

enter image description here

advantage: it's simple

Upvotes: 1

TheMaster
TheMaster

Reputation: 50751

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.

Upvotes: 1

Related Questions