+ Reply to Thread
Results 1 to 46 of 46

Adjusting an IF formula

  1. #1
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Adjusting an IF formula

    I asked a question before, but maybe I worded it wrong...
    I desperately need an IF formula that will do the following,,,

    If A1 is 4 then add 75 and/or
    If A1 is 5, then add 85 and/or
    If A1 is 6, then add 95 and so on to a max of 190

    Could someone help me please?
    Last edited by JBeaucaire; 02-27-2013 at 09:13 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

    Re: Could someone help me with an IF Formula

    Maybe:

    =35+(A1*10)

    Or

    =MIN(35+(A1*10), 190)
    _________________
    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
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    A1 is the date
    The late fee or $75-$190 would be in cell D1
    Wouldn't that be an IF formula?

  4. #4
    Registered User
    Join Date
    02-27-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Adjusting an IF formula

    Is A1 in an actual Date format? Since you are assigning late fees, it seems that you will need to first use two date fields to find out how many days late the item is. Then and only then could you write a formula. Also be aware that you cannot use a formula in one cell to increment the value of another cell. In other words you cannot just keep adding to an existing value based on an if condition. You can only have the value of the cell change based on the state of another cell to another value. Once you have the number of days... JBeaucaire's formula =MIN(35+(A1*10), 190) is elegant and will work.

  5. #5
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    so, I think I understand what you are saying....
    I would need to add a cell with like say 5 in it saying that they are five days late, then in the late fees cell, your formula would work?

  6. #6
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: Adjusting an IF formula

    Hi, laurabach.

    Better if you upload example of your file. That will more easy to anyone to analysis what you need.
    Click (*) if you received helpful response.

    Regards,
    David

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

    Re: Adjusting an IF formula

    If

    A1 had a due date
    B1 had a date paid
    C1 Late fee formula would be:

    =IF(AND(COUNT(A1:B1)=2, B1>A1, B1-A1>3), MIN(35+((B1-A1)*10), 190), "")

  8. #8
    Registered User
    Join Date
    10-31-2012
    Location
    Victoria, Australia
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: Adjusting an IF formula

    Is this what you are looking for =IF(NOW()-A1>=5,MIN(35+(FLOOR(NOW()-A1,1)*10), 190),)

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

    Re: Adjusting an IF formula

    I would caution against using NOW() or TODAY() since that formula will increase forever. The late fees would be an indication of when the payment was finally paid, yes?

  10. #10
    Registered User
    Join Date
    10-31-2012
    Location
    Victoria, Australia
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: Adjusting an IF formula

    Adding the extra column of dates as required in JBeaucaire response is the better way to go.

  11. #11
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    Okay, here is my work book...
    If they pay on the 4th, we need to add $75.00 in late fee column
    If they pay on the 5th, we need to add $85.00 in late fee column
    If they pay on the 6th, add $95.00 and so on, adding $10.00 per day up to $190.00

    Please help...
    Thank you all so much!!
    Attached Files Attached Files

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

    Re: Adjusting an IF formula

    1) Do not split the MONTH and DATE out to separate fields in B:C, just have a single date field where regular dates can be entered.
    2) Since you already HAVE two fields, make one the Date Due field (B4), make the other the Date Paid field (C4) as recommended previously
    3) Take the formula given in post #7 and replace the references to A1 with B4 and B1 with C4, then enter the formula in I4.

  13. #13
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    I tried what you said, but no matter what date I put in, it automatically added $190.00...please help?
    Oh, and on my spreadsheet,
    the due date is cell B19
    The date paid is cell C19
    and the late fee is in I19
    Thank you for all your help....I really need this for my boss, she is counting on me

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

    Re: Adjusting an IF formula

    The formula works. Time to show us your work. Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook. Make sure the workbook includes your verson of the formula so we can see what has been done.

  15. #15
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    okay, I put it in...thank you so very much!!
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    And here it is with the formula...I'm sorry
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    10-31-2012
    Location
    Victoria, Australia
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: Adjusting an IF formula

    Unfortunately you didn't put in your formula as requested by JBeaucaire however to save subsequent frustration
    Change your headings as directed to
    RECEIPT NUMBER Due Paid

    Your problem appears to be your test date at B21 is 1/01/1900 and your date at C21 is 4/01/2013 (Needs more than your Max fee of $190)
    Formula at I21 is =IF(AND(COUNT(B21:C21)=2, C21>B21, C21-B21>3), MIN(35+((C21-B21)*10), 190), "")

  18. #18
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    OKAY, I changed what you said, and put the formula in...please help? It is still not working
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    10-31-2012
    Location
    Victoria, Australia
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: Adjusting an IF formula

    It appears to work fine for me when I put in proper dates into B21 and C21 (You have no's 1 and 4 in your supplied sheet)

  20. #20
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: Adjusting an IF formula

    Hi, laurabach.
    see this formula (red)
    Please Login or Register  to view this content.
    Because you input 1 and 4, the result by that formula = 3, the last result ="". If you input 1 and 5 the result = 75

  21. #21
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    Tiger, how did you do the date? 02/01/13 or 02/01?

  22. #22
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    Yes, it works!! the only problem is that on the 4th it should say $75.00 and then go up each day by $10.00 to $190.00 and it only works with the 5th and up

  23. #23
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Adjusting an IF formula

    Hello Laura - that formula looks like it should work to me - what do you have in B21 and C21 when it doesn't?
    Audere est facere

  24. #24
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    927

    Re: Adjusting an IF formula

    Tested your formula, works ok.

    HTML Code: 
    Last edited by rollis13; 03-01-2013 at 07:11 PM.

  25. #25
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    B21 is 02/01/13
    C21 is 02/04/13

  26. #26
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Adjusting an IF formula

    Quote Originally Posted by laurabach View Post
    B21 is 02/01/13
    C21 is 02/04/13
    If you are counting that as 4 (because 02/01/13 is day one) then perhaps formula needs to be adjusted like this

    =IF(AND(COUNT(B21:C21)=2,C21-B21>2),MIN(45+(C21-B21)*10,190),"")

  27. #27
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    Thank you so very much!! That works!!

  28. #28
    Registered User
    Join Date
    10-31-2012
    Location
    Victoria, Australia
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: Adjusting an IF formula

    Yes I was about to suggest the same formula changes as in daddylonglegs if you are counting the 4 as the 4th day. The formula till now has been after 4 clear days the fees start on the 5th day.

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

    Re: Adjusting an IF formula

    If that takes care of your original query, please select Thread Tools from the menu above and mark the thread as solved. Thanks.

  30. #30
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    I'm hoping that I can ask another question. The formula that I got off here on the I cells is correct, the only problem is, if they don't have a late fee, I have to put a 0 in the cell to carry it over to the balance or M and N cells. When I put the 0 in, the formula goes away and therefore when the sheet is full, I have to re-enter the formula. I hope this makes sense. If they do not owe any late fee and pay before the 4th, is there a way to tweak the formula so that we don't have to enter anything in the I cell and the formula stays intact?

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

    Re: Adjusting an IF formula

    You can expand your formula to add other IF tests at the beginning...

    For instance, assuming there was a "yes" or "no" in column L for late fee, you could do something like this:

    =IF(L21="No", "", IF(AND(COUNT(B21:C21)=2,C21-B21>2),MIN(45+(C21-B21)*10,190),""))

    Notice the FALSE results in your original formula being executed.

  32. #32
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    I tried it and it didn't work...I copied and pasted your formula but it doesn't work for me. Maybe I am doing something wrong?

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

    Re: Adjusting an IF formula

    Mine was an example, of course, I wouldn't expect it to work without you correcting it.

    Where are your "late fee" flags? What are the flags?

  34. #34
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    I don't want to sound stupid, but I don't understand. What are flags?

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

    Re: Adjusting an IF formula

    "flag" is a term for "information in a cell that means something specific to me".

    You're talking about late fees. Explain where/what/how late fees are noted or not on one row.

  36. #36
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    If they pay before the 4th, there will not be any late fees, therefore the I column would be blank. I would like it to stay blank and then add across as long as they pay before the 4th

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

    Re: Adjusting an IF formula

    So my example formula which was looking at L21 for "no"

    =IF(L21="No", "", IF(AND(COUNT(B21:C21)=2,C21-B21>2),MIN(45+(C21-B21)*10,190),""))

    Does that mean you need to check column I instead for any value?

    =IF(I21="", "", IF(AND(COUNT(B21:C21)=2,C21-B21>2),MIN(45+(C21-B21)*10,190),""))


    I'm really trying to get you thinking about the technique I'm presenting, rather than suggest my formulas are correct.

    =IF(SomeTest, DoThisIfTrue, DoThisIfFalse)

    You'll need to figure out want the 'test" should be, then what the "true" and "false" responses need to be.

  38. #38
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    I am in the process of trying to find some good online classes in advanced excel. It is so hard to know which ones are good classes and which ones aren't.

    I am not sure that I understand what you are trying to tell me, but right now, the formula that you gave me a while back works as far as figuring in the late fee and it works wonderfully....but if they pay before the late fee kicks in, it makes me put 0.00 in the cell for the late fee in order to add across (otherwise, it just says #value!). By putting the 0.00 in the cell, it deletes my formula and when the page gets full, I have to go back and add the formula for the late fee again. This is not a problem for me, but they are wanting me to share this worksheet with many other offices and it might be for them. Therefore, I thought that there might be a formula for the current balance cell that would add up the row without anything in the late fee cell. Therefore, I guess I am asking for a formula for cell N that will add across without there being a late fee in the late fee cell.

    I hope this makes sense

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

    Re: Adjusting an IF formula

    Feel free to post a small sample workbook with some sample data rows showing the formulas being used and the current results, then the desired results. Always easier if we have something to look at, yes?

  40. #40
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    Okay, thank you so much. See if there isn't a late fee, then it won't go across. I'm sorry, I thought I had put in a worksheet. But on the third and fourth line, there isn't a late fee, so it won't add across, unless I put in 0.00 and that erases our wonderful formula
    Thank you so much
    Attached Files Attached Files

  41. #41
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    I inserted the wrong worksheet...but I'm sure you get the idea..but here is another one that actually shows them paying on time and it not going across
    Thank you again
    Attached Files Attached Files

  42. #42
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    927

    Re: Adjusting an IF formula

    Since JBeaucaire isn't on line at the moment, have a try changing his Late Fee formula to:

    =IF(AND(COUNT(B21:C21)=2,C21-B21>2),MIN(45+(C21-B21)*10,190),0)

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

    Re: Adjusting an IF formula

    No worries, Rollis, join in on any threads anytime you can help. Thanks.

    Did that work for you Laura?

  44. #44
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    927

    Re: Adjusting an IF formula

    Thank you for acceptance but now it's laurabach who is no longer online .

  45. #45
    Registered User
    Join Date
    02-27-2013
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2007
    Posts
    69

    Re: Adjusting an IF formula

    That worked perfect. You guys are wonderful!!!!

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

    Re: Adjusting an IF formula

    If that takes care of your question, select Thread Tools from the menu above and mark this thread as SOLVED. Thanks.

+ 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