Copy Data from a source to the blank space

datastudent

Board Regular
Joined
Sep 7, 2021
Messages
92
Office Version
  1. 365
Platform
  1. Windows
Hi,

How can I copy the data from "AAA" to "Fixed" and "Mobile" columns?

The principle is as follow:
1. If Fixed or Mobile or both are blank, copy data from AAA.
2. If AAA and Fixed are blank, copy data from Mobile to Fixed.
3. If AAA and Mobile are blank, copy data from Fixed to Mobile.
(AAA does not necessarily need to be filled)

Table 2 is the expected result.
Template_v1.xlsm
FGHIJKLMN
1CountryAAAFixedMobileCountryAAAFixedMobile
2ALBANIA0.120.3718ALBANIA0.120.3718
3ANGOLA0.14ANGOLA0.140.14
4ARGENTINA0.010.0261ARGENTINA0.010.010.0261
5ARMENIA0.1733ARMENIA0.17330.17330.1733
6AUSTRALIA0.02520.0110.0252AUSTRALIA0.02520.0110.0252
iBASIS_Outbound
 
Something like this,
Book1
ABCDEFGHI
1CountryAAAFixedMobileCountryAAAFixedMobile
2ALBANIA0.120.3718ALBANIA0.120.3718
3ANGOLA0.14ANGOLA0.140.14
4ARGENTINA0.010.0261ARGENTINA0.010.010.0261
5ARMENIA0.1733ARMENIA0.17330.17330.1733
6AUSTRALIA0.02520.0110.0252AUSTRALIA0.02520.0110.0252
Sheet1
Cell Formulas
RangeFormula
H2:H6H2=IF(C2="", IF(B2<>"", B2, IF(D2<>"", D2, "")), C2)
I2:I6I2=IF(D2="", IF(B2<>"", B2, IF(C2<>"", C2, "")), D2)
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top