+ Reply to Thread
Results 1 to 13 of 13

Fill a column with the same formula as previous cell no blank

  1. #1
    Registered User
    Join Date
    04-16-2010
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    31

    Fill a column with the same formula as previous cell no blank

    Hi

    I have a table with two columns; first dates and second codes and blank cells.
    Each code represents a formula. I want to fill with values the second column, applying a different formula to each cell with each code and to all the blank cells below.

    Basically the idea is to fill a range of empty cells automatically with a formula.

    I give a simple example in the attached file.

    Thanks
    Attached Files Attached Files
    Last edited by MFT; 05-04-2010 at 06:00 AM.

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Fill a column with the same formula as previous cell no blank

    Did you mean to attach a file? If so, it didn't quite make it.

  3. #3
    Registered User
    Join Date
    04-16-2010
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Fill a column with the same formula as previous cell no blank

    Sorry,

    There it is

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Fill a column with the same formula as previous cell no blank

    MFT,

    I'm not sure I understand. Your "expected results" already contain formulas that seem to deliver the expected results. What do you want to achieve?

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Fill a column with the same formula as previous cell no blank

    can you try explaining again
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  6. #6
    Registered User
    Join Date
    04-16-2010
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Fill a column with the same formula as previous cell no blank

    I'll try

    I have two columns. A column with dates and B column with codes and empty cells. Each time in the B column appears a code, I want to apply a formula and get a numerical value. The same formula should be applied to all the empty cells below the cell with the code, until next code (when the formula changes again).

    What I want is to expand the formula from the cell with the code, all over the blank cells below. Like I would do dragging down one corner of the cell. I wonder if Excel can do that automatically.

    I hope it makes more sense now. I will try to explain again if it is necessary

    Thanks

  7. #7
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Fill a column with the same formula as previous cell no blank

    MFT,

    I think you should engage helper columns like you did in the attached sample. Otherwise, if you try to apply the formulas to column B directly, you'll end up with circular references.

    Typically, in a well designed spreadsheet, you'll either have data entry cells or cells with formulas. Creating a column where the cell contents is either a value or a formula will always pose difficulties.

    I'm still not sure about your requirements, because your column B shows text in some cells, but the required results have formulas in the same row.

    Assuming that you want to show the text values in column B, you can create helper columns to calculate your values and then show a summary column that draws its values from the helper columns. Then hide the helper columns to create the illusion of only two columns.

    Hide all the shaded columns in the attached spreadsheet to end up with just two columns, delivering ( I believe) the result you are after.

    If that does not do it for you, I'm afraid you'll need to do some more explaining.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    04-16-2010
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Fill a column with the same formula as previous cell no blank

    Next try...

    I think it is still not clear... I attach a new example. This time I clarify what is my original data, what is my (unsuccesful) attempt and what is the expected result.

    The problem is to give an order to expand or fill blank cells with a formula. That formula changes every time appears a new code.

    As you can see in the expected results, I don't want to keep the code, I want a numerical value for every cell.
    Attached Files Attached Files

  9. #9
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Fill a column with the same formula as previous cell no blank

    Do you want the result in column B? You have the text value in column B, and that text value determines the formula to be used for the calculation, so you cannot have the formula in column B as well as the text values.

    The requirements are still not completely defined, I think.

  10. #10
    Registered User
    Join Date
    04-16-2010
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Fill a column with the same formula as previous cell no blank

    I want the result in column E, where I made the unsuccessful attempt.

    The column B is the original data, the initial information

    The column H represents what I expect to see in column E.

  11. #11
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Fill a column with the same formula as previous cell no blank

    Try this:

    =IFERROR(LOOKUP(LOOKUP(2,1/($B$2:B2<>""),$B$2:B2),{"aa","bb","cc"},{2,1.5,"MISS"})*(A2-$A$2),"MISS")

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Fill a column with the same formula as previous cell no blank

    Is this the same question, for which you got an answer for here?

    http://www.excelforum.com/excel-gene...ank-cells.html

    if so, please do not create duplicate questions... it wastes people's time as they don't know another thread is being worked on by someone else, and that you already received a satisfactory result.

    And you should close a thread if you didn't get a satisfactory answer...
    Last edited by NBVC; 05-03-2010 at 11:30 AM.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  13. #13
    Registered User
    Join Date
    04-16-2010
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Fill a column with the same formula as previous cell no blank

    Certainly.

    I am sorry, but I considered that this thread was completely forgotten. The correct answer is found in the following link:

    http://www.excelforum.com/excel-gene...ml#post2299295

    Sorry again

+ 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