+ Reply to Thread
Results 1 to 20 of 20

Lengthy formula !!

  1. #1
    Registered User
    Join Date
    08-09-2016
    Location
    India
    MS-Off Ver
    Office 2013
    Posts
    9

    Lengthy formula !!

    Hi can anyone please help me in reducing the length of this formula
    =IF(SUM(W7:Y7)<T7,(SUM(W7:Y7)/T7),IF(SUM(W7:Y7)>T7,(SUM(W7:Y7)-T7)/U7)+1)

    I'm a beginner level user of excel.
    Kindly help ASAP

    Thanks in Advance.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Lengthy formula !!

    If you only have those 2 tests, then it looks like you dont need that 2nd IF...

    =IF(SUM(W7:Y7)<T7,(SUM(W7:Y7)/T7),(SUM(W7:Y7)-T7)/U7)+1)
    what happens if it = T7?
    Last edited by FDibbins; 08-09-2016 at 02:00 AM. Reason: left out a ,
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    08-09-2016
    Location
    India
    MS-Off Ver
    Office 2013
    Posts
    9

    Re: Lengthy formula !!

    Hey thanks for the quick reply.
    I'll explain you the situation can you help me with the formula...?

    If SUM(W7:Y7)<T7 then it should be SUM(W7:Y7)/T7
    If SUM(W7:Y7)>T7 & <SUM(T7,U7) then it should be (SUM(W7:Y7)-T7)/U7)+1
    If SUM(W7:Y7)>SUM(T7,U7) then it should be (SUM(W7:Y7)-SUM(T7,U7)/V7)+2

    I need a formula which satisfies the above conditions.
    As i have mentioned in the previous thread I'm a beginner level user of excel.
    It would be of great help if u help me with the formula.

    Thanks in Advance.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Lengthy formula !!

    A shot in the dark...
    =if(SUM(W7:Y7)>t7,SUM(W7:Y7)/t7, if(and(SUM(W7:Y7)>t7,SUM(W7:Y7)<t7+u7,((SUM(W7:Y7)-t7)/u7)+1, (SUM(W7:Y7)-SUM(T7,U7)/V7)+2))

    (it's late and my brain went to bed long before me lol)

  5. #5
    Registered User
    Join Date
    08-09-2016
    Location
    India
    MS-Off Ver
    Office 2013
    Posts
    9

    Re: Lengthy formula !!

    Hey Thanks for the reply but it didn't work

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Lengthy formula !!

    Your requirement is ambiguous. What if the sum = T7, or =sum T7+U7???
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  7. #7
    Registered User
    Join Date
    08-09-2016
    Location
    India
    MS-Off Ver
    Office 2013
    Posts
    9

    Re: Lengthy formula !!

    In my case it wil never be equal to T7 or T7+U7 !!

    I know i'm being naive. But believe me i have done manual calculations on paper so i can say that it won't be equal.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,745

    Re: Lengthy formula !!

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Lengthy formula !!

    Try this out:

    =IF(SUM(W7:Y7)<T7,SUM(W7:Y7)/T7,IF(AND(SUM(W7:Y7)>T7,SUM(W7:Y7)<SUM(T7,U7)),1+(SUM(W7:Y7)-T7)/U7,IF(AND(SUM(W7:Y7)>T7,SUM(W7:Y7)>SUM(T7,U7)),2+(SUM(W7:Y7)-T7)/V7)))
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    08-09-2016
    Location
    India
    MS-Off Ver
    Office 2013
    Posts
    9

    Re: Lengthy formula !!

    Hey guys i have finally got the formula which gave the correct answers....

    =IF(SUM(W7:Y7)<T7,SUM(W7:Y7)/T7,IF(AND(SUM(W7:Y7)>T7,SUM(W7:Y7)<SUM(T7,U7)),1+(SUM(W7:Y7)-T7)/U7,IF(SUM(W7:Y7)>T7+U7,(SUM(W7:Y7)-SUM(T7,U7))/V7)+2))

    ThanK you Glenn, with some modifications to your formula i got the result.

    Now is it possible to make it shorter...?

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,745

    Re: Lengthy formula !!

    As I said before, attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Lengthy formula !!

    Why do you want to make it shorter. It's not long... and if it works???

  13. #13
    Registered User
    Join Date
    08-09-2016
    Location
    India
    MS-Off Ver
    Office 2013
    Posts
    9

    Re: Lengthy formula !!

    Hey ali I'm attaching the file....plz help me

    Refer to the column Z (payback absolute)
    Attached Files Attached Files
    Last edited by ramNrocky; 08-09-2016 at 05:39 AM.

  14. #14
    Registered User
    Join Date
    08-09-2016
    Location
    India
    MS-Off Ver
    Office 2013
    Posts
    9

    Re: Lengthy formula !!

    Glenn its fine for me and its working too. But my friend is insisting me to shorten it. so i'm asking

  15. #15
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: Lengthy formula !!

    If you used a helper column (let's say column Z) with this formula in Z7:

    =SUM(W7:Y7)

    then your formula from Post #10 would become:

    =IF(Z7<T7,Z7/T7,IF(AND(Z7>T7,Z7<SUM(T7,U7)),1+(Z7-T7)/U7,IF(Z7>T7+U7,(Z7-SUM(T7,U7))/V7)+2))

    as that expression occurs several time in the formula.

    Hope this helps.

    Pete

  16. #16
    Registered User
    Join Date
    08-09-2016
    Location
    India
    MS-Off Ver
    Office 2013
    Posts
    9

    Re: Lengthy formula !!

    But that is Ony for row 7. I got a total of 42 rows. How do i use a helper column in that case ?

  17. #17
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: Lengthy formula !!

    You copy the formulae down to cover the 42 rows.

    Hope this helps.

    Pete

  18. #18
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: Lengthy formula !!

    Quote Originally Posted by ramNrocky View Post
    In my case it wil never be equal to T7 or T7+U7 !!

    I know i'm being naive. But believe me i have done manual calculations on paper so i can say that it won't be equal.
    As you stated here if they will never be equal then you can use this:

    Please Login or Register  to view this content.

  19. #19
    Registered User
    Join Date
    08-09-2016
    Location
    India
    MS-Off Ver
    Office 2013
    Posts
    9

    Re: Lengthy formula !!

    That doesn't help @sanram

    Thank you for your reply.

  20. #20
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: Lengthy formula !!

    Quote Originally Posted by ramNrocky View Post
    That doesn't help @sanram

    Thank you for your reply.
    Oh, Really!! But it was working on my system. You can see the attachment. But sorry that I couldn't help.
    Attached Files Attached Files

+ 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] scrolling lengthy formula with ranges question?
    By lilsnoop in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-08-2016, 05:22 PM
  2. [SOLVED] Ignore Text or non-date value in lengthy formula
    By Ray1971 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-12-2014, 07:38 AM
  3. shortening a lengthy formula
    By _Martin in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-05-2009, 03:39 PM
  4. Lengthy IF formula trouble
    By carlosbourn in forum Excel General
    Replies: 2
    Last Post: 06-12-2009, 11:18 AM
  5. Lengthy problem - I am in need of help!
    By paultucker79 in forum Excel General
    Replies: 5
    Last Post: 06-20-2006, 05:50 AM

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