+ Reply to Thread
Results 1 to 12 of 12

Add values of cells from differenct columns to new column only if cells are not blank

  1. #1
    Registered User
    Join Date
    02-28-2014
    Location
    greece
    MS-Off Ver
    Excel 2007
    Posts
    6

    Add values of cells from differenct columns to new column only if cells are not blank

    Good day,

    I have an excel file and what i want is to sum two different columns to a third one, however there are some important notes:

    1. Column A has dates
    2. Column B has numbers f.e. 25, 30, 35 etc. , which have to be added to dates of column 1 , so a new date will be created in the new column
    3. Colums A and B are not next to each other.
    4. Some cells of column A and column B are blank , actually columns are sth like this
    A B C
    5/2/2014 25
    blank blank
    8/5/2014 35
    10/9/2014 30
    blank blank

    When a date value occurs in a cell of column A , then always a number will occur in column B
    When a cell is blank is column A , then the respective cell of column B will also be blank

    What i want is to add values of column A and B to create column C automatically ( each column has 1000 cells ) , however in case of blank cells , i want a blank cell in column C, not something like #####
    Apart from this , i want in the future , when i expand column A and B , when values are entered there, i want column C to be created automatically

    I hope what i say is easily understood and am kindly waiting for advise

    Thank you and regards

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Add values of cells from differenct columns to new column only if cells are not blank

    Hi and welcome to the forum(Γειά σου Γιώργο?)

    Your request is not clear. Pls upload a small sample workbook for better understanding


    To attach a small sample workbook.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: Add values of cells from differenct columns to new column only if cells are not blank

    Apart from this , i want in the future , when i expand column A and B , when values are entered there, i want column C to be created automatically
    Adding this to the requirements, will mean that the solution will have to be VBA. Suggest you upload a sample worksheet so that the VBA can be tested to work in your environment. If this requirement is not critical or you do not want a VBA solution, then you can use the following formula in Column C

    =if(A1="", "", A1 + B1) and format C1 as a date, then copy down the length of your worksheet.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    02-28-2014
    Location
    greece
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Add values of cells from differenct columns to new column only if cells are not blank

    Hello and thank you for answers!


    what i want in column I is : to add F days to E date
    and in column J : to add G days to E date
    If cell in column E-F-G is blank , then i want blank cell in columns i and J !

    I uploaded an example!

    thanks in advance!
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-28-2014
    Location
    greece
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Add values of cells from differenct columns to new column only if cells are not blank

    The problem is that if i type a simple Sum command and do it for all cells of I and J columns , i get a result like ####### when blank data is in columns E F G !!!

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Add values of cells from differenct columns to new column only if cells are not blank

    So in I1 and copy down use this.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: Add values of cells from differenct columns to new column only if cells are not blank

    And here is a vba solution possibility.

    Please Login or Register  to view this content.
    Place this in the worksheet event for Sheet 1

  8. #8
    Registered User
    Join Date
    02-28-2014
    Location
    greece
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Add values of cells from differenct columns to new column only if cells are not blank

    Fotis1991 Thank you-Eyxaristw Poly!! +++++

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Add values of cells from differenct columns to new column only if cells are not blank

    Παρακαλώ! You are welcome and thanks for the feed back.

    In fact is the same suggestion as Alan did in his first post which i didn't noticed. Sorry Alan.

    As that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED,as per Forum Rule #9. Thank you.

  10. #10
    Registered User
    Join Date
    02-28-2014
    Location
    greece
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Add values of cells from differenct columns to new column only if cells are not blank

    DOne! Have a nice weekend!

  11. #11
    Registered User
    Join Date
    02-28-2014
    Location
    greece
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Add values of cells from differenct columns to new column only if cells are not blank

    Hello it seems that this is not yet solved!
    If I type a date in column E without typing a number in column F then the result in column I is the same as the date in column E ! I dont want column I to be filled unless i type the number in column F ! ( it has to do with my job so sometimes even if i know the date, i do not know immediately the number which i have to input in column F - i might know it after one week )
    Tks and sorry for bothering again!

  12. #12
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: Add values of cells from differenct columns to new column only if cells are not blank

    Did you look and try my VBA solution. It should not populate until you have values in Columns F and G, respectively

+ 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. [SOLVED] Macro to fill blank cells in column A based on non-blank cells
    By ktalamantez in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2014, 02:47 PM
  2. [SOLVED] Copy non blank cells in a range where there are certain values in another column
    By Knocknaboula in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-23-2013, 08:51 AM
  3. How to fill blank cells with different values in a column
    By intermine in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-05-2010, 12:43 AM
  4. Replies: 3
    Last Post: 01-07-2010, 02:30 PM
  5. Copy nonerror values from a column to new column, no blank cells in between
    By farmerdave in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-24-2009, 12:47 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