+ Reply to Thread
Results 1 to 26 of 26

how to do a progressive add with an IF clause that is interrupted.

  1. #1
    Registered User
    Join Date
    07-21-2006
    Posts
    23

    how to do a progressive add with an IF clause that is interrupted.

    I am running a sales spreadsheet that requires sales entered each day. I use a simple formula to run a continuous total starting at Monday and ending Sunday (1st cell for sales input is B4, second D4, third F4 and so on. 1st Cell for accumulated sales is C4, second E4 and third G4 and so on.
    I use B4+D4 to caluculate the running total in E4 or example,and to eliminate that total appearing in G4 where the next formula is B4+D4+F4 I precede that with an IF formula IF(E4=0,'', ). This way I only show the current Week to date totals, not the upcoming days in the rest of the week. My problem lies in Holidays. If for instance D4, the Tuesday was a holiday and I enter either "holiday" or just leave it blank, the rest of the weeks formula will not work. I get a Value message. How can I achieve my goal of getting a daily week to date total without having it show in the upcoming days AND have a holiday in there too??? Any suggestions would be appreciated. Thank you John
    Last edited by john48; 01-03-2009 at 10:02 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    Let's see it.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Welcome to the forum, John.

    In order to avoid having to answer the same questions every day, we require that posters compose thread titles that make the forum usefully searchable. Your title doesn't advance that goal.

    Please take a few minutes to read the Forum Rules about thread titles, and then edit yours to make it descriptive of your problem.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    07-21-2006
    Posts
    23
    sorry....where can i find out how to edit the title?

  5. #5
    Registered User
    Join Date
    07-21-2006
    Posts
    23
    how do I post the spreadsheet....it won't copy onto the posting reply?

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    sorry....where can i find out how to edit the title?
    Follow the link in my last post to the forum rules.
    how do I post the spreadsheet....it won't copy onto the posting reply?
    Click the button with the paper clip, or scroll down to the Manage Attachments button.

  7. #7
    pinmaster
    Guest
    Hi,

    Why not just use 1 column for your running total? It would be simpler and cleaner. Then you could use something like this:

    SUMIF(B4:F4,">0",B4:F4)
    HTH
    Jean-Guy

  8. #8
    Registered User
    Join Date
    07-21-2006
    Posts
    23

    attached spreadsheet with the IF formula and continuous addition problem

    I have attached the spreadsheet which shows the problem. If you were to enter the value 200 in H4 instead of "holiday" the sheet is ok..but I need to be able to enter holidays when they occur. any help would be really appreciated. tx John
    Attached Files Attached Files

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Thanks.

    The formulas could be made simple if you used a separate row for each item (Plan, Cumulative Plan, Actual, Cumulative Actual, etc.)

    Is that a possibility?

  10. #10
    Registered User
    Join Date
    07-21-2006
    Posts
    23
    I am unfortunately tied to this design because of another project it is tied to. Is there any way to make it work in the current configoration?

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Maybe as attached. Please note that the formulas added to cols C, E, G, ... are array formulas. If you edit them, they need to be confirmed with Ctrl+Shift+Enter, not just Enter.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    07-21-2006
    Posts
    23
    I think you have the solution....how do I fix the remaining problem with the total in P4? tx for so much help John

  13. #13
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    In P4 just enter =O4

    In P5, =O5

  14. #14
    Registered User
    Join Date
    07-21-2006
    Posts
    23
    Whoops....I also now have the additional problem below in the percentage payroll column
    I19 where it refers to H4 (and all the other cells across)...this is getting quite complicated...is there a solution you can help me with again...so sorry to ask but really need to fix this as it is going to be presented in a couple of days..tx a million John

  15. #15
    Registered User
    Join Date
    07-21-2006
    Posts
    23
    When I do =o5 in P5 it shows the negative number in O5 as a positive in P5?

  16. #16
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    In C4 and copy to odd columns right, =IF( ISNUMBER(B4), C18 / (B4*1000), "") (though I don't understand the formula)

  17. #17
    Registered User
    Join Date
    07-21-2006
    Posts
    23
    Do I need array formulas in lines 19,20 and 21? Can I adapt the same ones?

  18. #18
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    I appreciate the arrays and all, but I'm old school. You have cumulative totals available already in the columns, so simple "checks" to see if anything has been entered into the daily PLANNED/ACTUAL before allowing that day's accumulation totals to appear seems good enough, and easier to maintain.

    This version of your sheet does what I think you want without any of extra overhead of arrays and such. Worth a look.
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    07-21-2006
    Posts
    23

    Almost there...thank you...attached revised spread with one more problem

    Hi Again....I have made alterations based on your suggestions and populated the spreadsheet so you can see what it is supposed to do. The only problem I would like to solve, but not sure how to do it is in the accumulated totals getting ahead of the actual daily entries as you can see in M4 and M5 and O4 and O5. Is there a way to ensure that the totals in those and the similar preceding ones only populate when values are entered into L4 and N4? Thanks again for all your help. John
    Attached Files Attached Files

  20. #20
    Registered User
    Join Date
    07-21-2006
    Posts
    23

    thanks but some problems still.

    Hi JB...thanks for your help...I have attached the version of the spreadsheet you posted and illustrated a couple of further solutions needed please! the holiday has effected the cummulative sales in E3 and subsequently the overall total. It has also effected E20 amd E21 which refer to D4...And I would really like the sales variances not to appear until the actual sales for the day are entered as in N5 and o5 which shouldn't show until N4 is entered.
    Thanks for all your help so far...I have so much to learn. If you can help me further I would appreciate it. I also posted another version which is interesting but not quite there yet either. So close and yet so far!! tx a million. John
    Attached Files Attached Files

  21. #21
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    I had already implemented a fix for this for you in row 19, leaving rows 20 and 21 for you to do...a chance to apply what you see already being done.

    Anyway, here you go.
    Attached Files Attached Files

  22. #22
    Registered User
    Join Date
    07-21-2006
    Posts
    23
    Hi JB, thank you very much...I didn't spot the earlier fix, but tx for finishing it off...a couple of questions if you don't mind for my own learning. (I did learn the ISBLANK and ISTEXT IF's which was great!), but in the formula in E4 which goes =IF(ISBLANK(D4),0,IF(ISTEXT(D4),C4,D4+C4)), I can follow the logic, but why do you need the D4+C4 after the C4?
    I read it as if D4 is blank then 0, if D4 is text then D4+C4, but if D4 is text,then wouldn't you get an error message and shouldn't it more logically just be IF(ISTEXT(D4),C4 only? regards John Sorry, just trying to learn!

  23. #23
    Registered User
    Join Date
    07-21-2006
    Posts
    23

    Solved!

    Thanks for all the help...I learned some new things as I mentioned, IFTEXT, IFBLANK, and MAX. Have a question about how P$ works and my previous question already posted.
    Also learned more about Arrays...must investigage further there.

    Anyway...thanks for all the help again...it was really appreciated. regards John
    Attached Files Attached Files

  24. #24
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    Glad to help!

    If that takes care of your need, be sure to EDIT your original post (Go Advanced) and mark the PREFIX box [SOLVED]

  25. #25
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    Quote Originally Posted by john48 View Post
    Hi JB...in the formula in E4 which goes
    =IF(ISBLANK(D4),0,IF(ISTEXT(D4),C4,D4+C4))

    I can follow the logic, but why do you need the D4+C4 after the C4?
    I read it as if D4 is blank then 0, if D4 is text then D4+C4, but if D4 is text,then wouldn't you get an error message and shouldn't it more logically just be IF(ISTEXT(D4),C4 only? regards John Sorry, just trying to learn!
    If D4 is blank, return zero
    If D4 has text in the cell, bring over the grand total from C4
    If D4 is not blank and does not have text in it, add D4 and C4 together to create a new grand total

    OK?

  26. #26
    Registered User
    Join Date
    07-21-2006
    Posts
    23
    thanks JB....you have been very patient and helpful....rgds John

+ 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