+ Reply to Thread
Results 1 to 8 of 8

If one cell is blank, how do I copy the cell to the immdediate left

  1. #1
    Registered User
    Join Date
    02-25-2009
    Location
    U.S
    MS-Off Ver
    Excel 2007
    Posts
    25

    If one cell is blank, how do I copy the cell to the immdediate left

    I have Column A and Column B. Every row in column A is populated, but only some of the rows in column B are populated. I need a formula that copies column A if B is blank. (i.e. If B6 is blank, copy A6). Thoughts?

    Thanks! This website is truly awesome!
    Last edited by Jeff M; 04-07-2009 at 10:03 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: If one cell is blank, how do I copy the cell to the immdediate left

    Does the following work for you ?

    C6: =IF(B6="",A6,B6)

  3. #3
    Registered User
    Join Date
    02-25-2009
    Location
    U.S
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: If one cell is blank, how do I copy the cell to the immdediate left

    Works great! I would like to take it to the next level if you can help. Now if I told you both columns A and B were formatted as dates, and I wanted to copy row A6 minus one day if B6 is blank, what would you say?
    (i.e. If B6 is blank and A6 is 3/6/2009, I want B6 to then read 3/5/2009) Any Ideas? Thanks!

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: If one cell is blank, how do I copy the cell to the immdediate left

    I would then suggest:

    C6: =IF(B6="",A6-1,B6)

    The above is based on the fact that in XL Dates are Integers and Time is Decimal... on 1900 Date System day 1 is 1st Jan 1900 and today (7th April) is 39910... hence you can add/subtract with dates as you would numbers.

  5. #5
    Registered User
    Join Date
    02-25-2009
    Location
    U.S
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: If one cell is blank, how do I copy the cell to the immdediate left

    It turns the date into a number format and screws up the formatting. I think this will work though. Thanks for your help!

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: If one cell is blank, how do I copy the cell to the immdediate left

    Format the cell/range to use a Date format (rather than General or Number)

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: If one cell is blank, how do I copy the cell to the immdediate left

    i give up !
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  8. #8
    Registered User
    Join Date
    03-28-2011
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: If one cell is blank, how do I copy the cell to the immdediate left

    Thank you, thank you! You people are Swell! I am wondering how I can check a cell and if it is blank insert a value without reference to another cell. e.g. If d1 is blank then date of 1/1/1920.

    Thanks again!
    Last edited by krishna007; 03-28-2011 at 05:38 PM. Reason: exporting data to another database

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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