+ Reply to Thread
Results 1 to 13 of 13

Too Long formula to shorten help

  1. #1
    Forum Contributor
    Join Date
    08-29-2006
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    314

    Too Long formula to shorten help

    Dear all
    I have a excel sheet which has a long invoice list and column M has invoice the date. I like to work out aged debt for each invoice on a cell as "Current","31-60","61-90","91-120","121-150","151-180","181-210","211+".When I have type this fomula, it works up to "151-180" anything after that woulnd work. I tkink the formula is too long.

    Is there a way to shorthen this formula or is there a way to create a Public Function so that I dont have to type a long formula?


    =IF(TODAY()-M3<=30,"Current ",
    IF(AND(TODAY()-M3>=31,TODAY()-M3<=60),"31-60",
    IF(AND(TODAY()-M3>=61,TODAY()-M3<=90),"61-90",
    IF(AND(TODAY()-M3>=91,TODAY()-M3<=120),"91-120",
    IF(AND(TODAY()-M3>=121,TODAY()-M3<=150),"121-150",
    IF(AND(TODAY()-M3>=151,TODAY()-M3<=180),"151-180",
    IF(AND(TODAY()-M3>=181,TODAY()-M3<=210),"181-210",
    IF(TODAY()-M3<=211,"211+”))))))))


    thank you very much for your help in advance.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Too Long formula to shorten help

    Hi,

    Please upload the workbook so that we can see the request in context. Manually add a few example results so that we can see precisely what you expect and note which are the result cells and how you arrived at the result.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: Too Long formula to shorten help

    Maybe this one may shorten
    =VLOOKUP(TODAY()-M3,{0,"Current";31,"31-60";61,"61-90";91,"91-120";121,"121-150";151,"151-180";181,"181-210";211,"211+"},2,1)
    Appreciate the help? CLICK *

  4. #4
    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: Too Long formula to shorten help

    Just as an FYI, in your last part, this... IF(TODAY()-M3<=211,"211+”))))))))
    it should be this to work... IF(TODAY()-M3>=211,"211+”))))))))
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Forum Contributor
    Join Date
    08-29-2006
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    314

    Re: Too Long formula to shorten help

    Thank you for your reply Richard Buttrey

    I have now uploaded the excell sheet, Colum Q (Aged) has the formula.

    kind regards
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    08-29-2006
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    314

    Re: Too Long formula to shorten help

    Quote Originally Posted by Sambo kid View Post
    Just as an FYI, in your last part, this... IF(TODAY()-M3<=211,"211+”))))))))
    it should be this to work... IF(TODAY()-M3>=211,"211+”))))))))
    I seee it has a typo on this line but the problem is excel not excepting the long formula

  7. #7
    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: Too Long formula to shorten help

    Yes, my guess is your version of excel is older but you didn't list what it is. It works fine in mine with the correction. AZ-XL's formula also works for me, have you tried that?

    EDIT: got that answer below.

  8. #8
    Forum Contributor
    Join Date
    08-29-2006
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    314

    Re: Too Long formula to shorten help

    Quote Originally Posted by AZ-XL View Post
    Maybe this one may shorten
    =VLOOKUP(TODAY()-M3,{0,"Current";31,"31-60";61,"61-90";91,"91-120";121,"121-150";151,"151-180";181,"181-210";211,"211+"},2,1)

    thank you very much it looks like this has solved the problem. you are a legend!!

    Thank you for all of you

  9. #9
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: Too Long formula to shorten help

    Did you test my formula. what is problem with mine? Post N3

  10. #10
    Forum Contributor
    Join Date
    08-29-2006
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    314

    Re: Too Long formula to shorten help

    Quote Originally Posted by Sambo kid View Post
    Yes, my guess is your version of excel is older but you didn't list what it is. It works fine in mine with the correction. AZ-XL's formula also works for me, have you tried that?

    EDIT: got that answer below.
    Thank you , yes I have tried and it worked perfectly.

  11. #11
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: Too Long formula to shorten help

    OK
    You are welcome. Thanx for feedback

  12. #12
    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: Too Long formula to shorten help

    Yes, thanks too for the feedback.
    BTW, it does help people to know what version of excel you are working with for future so they can know what things might work for you.

  13. #13
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Too Long formula to shorten help

    Perhaps in Q2 copied down

    =LOOKUP(TODAY()-M2, {0,30,60,90,120,150,180,999},{"Current","31-60","61-90","91-120","121-150","151-180","Over 180"})

+ 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] formula too long, not sure how to shorten
    By Jane in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 01-18-2016, 11:54 PM
  2. [SOLVED] Shorten a very long Formula
    By Floydlevedale in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-15-2013, 09:39 AM
  3. [SOLVED] Shorten the long text
    By Solomon14all in forum Excel General
    Replies: 7
    Last Post: 09-15-2012, 05:43 PM
  4. shorten a long list
    By kamelkid2 in forum Excel General
    Replies: 2
    Last Post: 01-28-2011, 01:13 PM
  5. "IF" formula too long, can someone help me shorten it?
    By kevlar3d in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-26-2005, 02:28 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