+ Reply to Thread
Results 1 to 18 of 18

Data manipulation between cells or columns

  1. #1
    Registered User
    Join Date
    06-13-2022
    Location
    Oklahoma, USA
    MS-Off Ver
    2016
    Posts
    8

    Data manipulation between cells or columns

    Hi,
    I'm certainly not a power Excel user and there may be a simpler way to do what I need to do, but here goes. I have to columns, one with cell phone numbers and one with home phone number. What I need to do is have one column with a cell number in if it existed, and if not, then put in the home phone number. I got to the point of being able to use a formula to determine if the cell was empty or not, but I can't figure out a way to say if it is empty, then move or copy the data from the cell next it in the same row.
    I did see in another post that Excel can't use formulas to move or copy data and that VB script would be needed to do that. Is that correct?

    Columns.PNG

    Not sure if my image was inserted or not, but if it did, You can see that column E has 2, 3, and 4 populated with a "home number" while column F has those rows empty. I need to get those home phone numbers into the empty rows while leaving the cell numbers as they are when they are populated. The spreadsheet is nearly 1,000 lines long so I really would prefer an automated process for this if possible.

    Thanks for any help,

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,139

    Re: Data manipulation between cells or columns

    In column G..

    =IF(F2="",E2,F2)

    copied down. Then select column G. Copy/"Paste Values" into column F. Delete column G (and E, if you wish).
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,474

    Re: Data manipulation between cells or columns

    make a new column G.
    In G2 use the below formula:

    =IF(F2="",E2,F2)
    <----- If you are happy with your solution please click on the "* Add Reputation" as a way to say thank you.

  4. #4
    Registered User
    Join Date
    06-13-2022
    Location
    Oklahoma, USA
    MS-Off Ver
    2016
    Posts
    8

    Re: Data manipulation between cells or columns

    I don't think that will work. If there are rows that have both a cell phone number and a home number, this process would over write the cell phone I believe and I want to leave those cell phone numbers as they are.

  5. #5
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,474

    Re: Data manipulation between cells or columns

    you are incorrect about that. try it out it will work

  6. #6
    Registered User
    Join Date
    06-13-2022
    Location
    Oklahoma, USA
    MS-Off Ver
    2016
    Posts
    8

    Re: Data manipulation between cells or columns

    Hmm, I cut and pasted the formula in and it does indeed overwrite the cell number. And it's simply taking the phone number and incrementing the last digit upward by one for every row. (See below). What am I doing wrong?Attachment 783786

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Data manipulation between cells or columns

    G2=IF(COUNTA(E2:F2)=2,E2&", "&F2,IF(E2="",F2,E2)) and drag down.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  8. #8
    Registered User
    Join Date
    06-13-2022
    Location
    Oklahoma, USA
    MS-Off Ver
    2016
    Posts
    8

    Re: Data manipulation between cells or columns

    I'm sorry, all that formula does is empty the cells as I drag it down. Perhaps I'm not understanding something basic that other are assuming I would know. Attachment 783788

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Data manipulation between cells or columns

    You get answers of several forummembers. Please reply to whom you are replying.

    The added link is invaled, at least for me.

  10. #10
    Registered User
    Join Date
    06-13-2022
    Location
    Oklahoma, USA
    MS-Off Ver
    2016
    Posts
    8

    Re: Data manipulation between cells or columns

    Try this. The quick reply attaches rather than inserts it would seem.
    Columns01.PNG

  11. #11
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Data manipulation between cells or columns

    G2 refers to cell G2, you have pasted the formula in cell G1.

    The formula starts with =

    So the formula in cell G2 is

    =IF(COUNTA(E2:F2)=2,E2&", "&F2,IF(E2="",F2,E2))

  12. #12
    Registered User
    Join Date
    06-13-2022
    Location
    Oklahoma, USA
    MS-Off Ver
    2016
    Posts
    8

    Re: Data manipulation between cells or columns

    You are correct, I did place it in G1. However when I put in G2, (without the G2 in the front), I get the same blank cells.

    Column02.PNG

  13. #13
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Data manipulation between cells or columns

    Your second example is differant than your earlier question.

    Will post the new formula.

    =IF(COUNTA(B2:C2)=2,B2&", "&C2,IF(B2="",C2,B2))
    Last edited by oeldere; 06-13-2022 at 02:08 PM.

  14. #14
    Registered User
    Join Date
    06-13-2022
    Location
    Oklahoma, USA
    MS-Off Ver
    2016
    Posts
    8

    Re: Data manipulation between cells or columns

    I apologize if I didn't articulate it well. Before I ran the formula down the column, some were blank other had numbers. The premise is, that I have two columns and the automatic calling system can only one without a huge amount of effort. If they have a cell number, that is the number we want to use. But if we have only a home phone number and not a cell number, then I need to move the home phone number into that empty space. If a cell number already occupies the cell, i need to be left as it is.

  15. #15
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Data manipulation between cells or columns

    Then I suggest you try the offered solutions in #2.

    =IF(F2="",E2,F2) and drag down.

  16. #16
    Registered User
    Join Date
    06-13-2022
    Location
    Oklahoma, USA
    MS-Off Ver
    2016
    Posts
    8

    Re: Data manipulation between cells or columns

    Not getting the desired results with that.
    Attachment 783809

    However, =IF(F2>0,F2,E2) is doing the trick. It puts in in a different column but I can work with that.

    Thanks for you help.

  17. #17
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,474

    Re: Data manipulation between cells or columns

    Quote Originally Posted by CLHarrison View Post
    However, =IF(F2>0,F2,E2) is doing the trick. It puts in in a different column but I can work with that.

    Thanks for you help.
    Told you it would

  18. #18
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Data manipulation between cells or columns

    Glad I could help.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 09-21-2016, 01:14 PM
  2. Data (in columns) Manipulation/Re-arrangement using VBA
    By excelnewbie80 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2012, 01:47 AM
  3. Data manipulation - rows to columns
    By wibbleman12 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-15-2010, 05:58 AM
  4. Refrence cells and manipulation
    By jackandjill in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-09-2010, 05:20 AM
  5. Replies: 2
    Last Post: 12-18-2005, 08:20 PM
  6. macro to add in a column by manipulation of other columns
    By tifosi88 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-07-2005, 04:31 PM
  7. VBA code manipulation cells
    By Craig in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2005, 06:08 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1