+ Reply to Thread
Results 1 to 20 of 20

Formula to automatically pull total into correct date column

  1. #1
    Registered User
    Join Date
    09-13-2017
    Location
    Florida
    MS-Off Ver
    2013
    Posts
    50

    Formula to automatically pull total into correct date column

    I actually asked this question last year and was given an answer and it worked but has since stopped working and I cannot recreate it.

    I have 6 tabs in one workbook and I have them all set up for the basic entries

    PO/PR, Vendor, date, total and beside them I have months listed across the columns for our fiscal year October - September. I want the amount in column D to automatically go into correct month according to the date in column C.

    I want to copy this for all 6 tabs. I have no idea why the original formula isn't working any longer.

    I have attached an example
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Formula to automatically pull total into correct date column

    I'm using a helper row that you can hide. If you don't want the helper row then you can develop a formula for each column based on the month number.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    09-13-2017
    Location
    Florida
    MS-Off Ver
    2013
    Posts
    50

    Re: Formula to automatically pull total into correct date column

    Quote Originally Posted by dflak View Post
    I'm using a helper row that you can hide. If you don't want the helper row then you can develop a formula for each column based on the month number.
    Thank you. I am unfamiliar with a helper row? How does it work?

  4. #4
    Registered User
    Join Date
    09-13-2017
    Location
    Florida
    MS-Off Ver
    2013
    Posts
    50

    Re: Formula to automatically pull total into correct date column

    Quote Originally Posted by krisryan View Post
    Thank you. I am unfamiliar with a helper row? How does it work?
    I can't seem to copy and paste your formulas into my worksheet even after adding the helper bar. Is there a trick to it?

  5. #5
    Valued Forum Contributor ron2k_1's Avatar
    Join Date
    09-30-2009
    Location
    Not the USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    606

    Re: Formula to automatically pull total into correct date column

    Here is an unecessarily long formula that does not require a helper row:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Just ensure that the month labels in row 1 do not have a space, like in the case of May, June and July in your example have a space after the word. Please delete the space after the month label.
    Ron
    Knowledge is knowing that a tomato and pepper are fruits. Wisdom is knowing whether to put these in a fruit salad

    Kindly

    [1] Use code tags. Place "[code]" before the first line of code and "[/code"]" after the last line of code. Exclude quotation marks
    [2] Mark your post [SOLVED] if it has been answered satisfactorily by editing your original post in advanced mode.
    [3] Thank (using the little scale) those that provided useful help; its nice and its very well appreciated

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Formula to automatically pull total into correct date column

    Let's look at the formula: =IFERROR(IF(AND(MONTH($C4)=E$1,$C4<>""),$D4,""),"")

    We'll pick it apart from the "inside out" which is the way excel executes things: AND(MONTH($C4)=E$1,$C4<>"") - first of all, I am using partial absolute referencing for the cells - $C4 means always use column C, but when you copy the formula down, the row can change. E$1 means always used row 1 but when you copy the formula across, the column changes. Something like $A$1 means always use cell A1 no matter where the formula is copied to.

    So I did not want to type =IFERROR(IF(AND(MONTH($C4)=10,$C4<>""),$D4,""),"") in column E, =IFERROR(IF(AND(MONTH($C4)=11,$C4<>""),$D4,""),"") in column F, and so on. I put the 10, 11, 12, etc. on row 1 and arranged to have the formula look at that row. So with the dates ($C) and amounts ($D) locked by columns, and the month number ($1) locked by row, I only had to work out the formula in one cell. Then I could copy it to wherever I needed it. the unlocked parts of the row or columns in the formula are relative and change depending on where the formula is copied to.

  7. #7
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Formula to automatically pull total into correct date column

    @dflak I tried putting your formula in E4 but it doesn't fill in the amount.

  8. #8
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Formula to automatically pull total into correct date column

    Resend the spreadsheet with the error.

  9. #9
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Formula to automatically pull total into correct date column

    Okay here is the book with that formula in E4
    Attached Files Attached Files

  10. #10
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Formula to automatically pull total into correct date column

    Well, since you choose to remove the helper row, the original formula won't work. So I replaced the single formula with 12 separate formulas hard coded to the months at the head of columns.
    Attached Files Attached Files

  11. #11
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Formula to automatically pull total into correct date column

    Oh I didn't know it needed the helper row sorry. I'm just trying to learn.

  12. #12
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Formula to automatically pull total into correct date column

    Well now you have two examples of how to do it

  13. #13
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Formula to automatically pull total into correct date column

    My sincere apologies it works very well.

  14. #14
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Formula to automatically pull total into correct date column

    I misunderstood Bill's intent so I am editing the post.

    Last edited by Sam Capricci; 01-25-2018 at 08:38 AM.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  15. #15
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Formula to automatically pull total into correct date column

    I was trying to do something similar but have different years for each worksheet. Is this a possibility ?

    Reference post: "Allocate Amount for Month"

  16. #16
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Formula to automatically pull total into correct date column

    No offense taken. You'll find there are many ways to do things in Excel. Ron_2K's implementation is even more ingenious.

  17. #17
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Formula to automatically pull total into correct date column

    I didn't know I was hacking I will not post and mark that as closed. In no way was I trying to cause any harm.

  18. #18
    Registered User
    Join Date
    09-13-2017
    Location
    Florida
    MS-Off Ver
    2013
    Posts
    50
    I can't tell you how much that helped. Thank you so much!
    Quote Originally Posted by dflak View Post
    Let's look at the formula: =IFERROR(IF(AND(MONTH($C4)=E$1,$C4<>""),$D4,""),"")

    We'll pick it apart from the "inside out" which is the way excel executes things: AND(MONTH($C4)=E$1,$C4<>"") - first of all, I am using partial absolute referencing for the cells - $C4 means always use column C, but when you copy the formula down, the row can change. E$1 means always used row 1 but when you copy the formula across, the column changes. Something like $A$1 means always use cell A1 no matter where the formula is copied to.

    So I did not want to type =IFERROR(IF(AND(MONTH($C4)=10,$C4<>""),$D4,""),"") in column E, =IFERROR(IF(AND(MONTH($C4)=11,$C4<>""),$D4,""),"") in column F, and so on. I put the 10, 11, 12, etc. on row 1 and arranged to have the formula look at that row. So with the dates ($C) and amounts ($D) locked by columns, and the month number ($1) locked by row, I only had to work out the formula in one cell. Then I could copy it to wherever I needed it. the unlocked parts of the row or columns in the formula are relative and change depending on where the formula is copied to.

  19. #19
    Registered User
    Join Date
    09-13-2017
    Location
    Florida
    MS-Off Ver
    2013
    Posts
    50
    Thank you. I definitely appreciate it. I will be using the helper row now that I understand it.
    Quote Originally Posted by ron2k_1 View Post
    Here is an unecessarily long formula that does not require a helper row:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Just ensure that the month labels in row 1 do not have a space, like in the case of May, June and July in your example have a space after the word. Please delete the space after the month label.

  20. #20
    Registered User
    Join Date
    09-13-2017
    Location
    Florida
    MS-Off Ver
    2013
    Posts
    50
    I am on my phone at the moment and am unable to give you rep but I will add it in the morning. Thanks again.
    Quote Originally Posted by krisryan View Post
    I can't tell you how much that helped. Thank you so much!

+ 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] SUMIF Date Formula not calculating correct total
    By SamCaunt in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 04-05-2017, 12:32 AM
  2. Replies: 6
    Last Post: 12-07-2016, 02:36 AM
  3. Replies: 6
    Last Post: 12-07-2016, 12:28 AM
  4. Replies: 1
    Last Post: 12-06-2016, 06:28 PM
  5. [SOLVED] Formula to automatically return date in correct cell based on date given
    By MichelleD75 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-10-2016, 01:29 PM
  6. [SOLVED] Formula to pull specific information from a list in the correct order
    By Sleepyshy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-05-2012, 11:36 AM
  7. Military time wont total correct in a column
    By rcgus in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-20-2008, 03:52 PM

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