+ Reply to Thread
Results 1 to 9 of 9

Two Ridiculously Long Formulae - Can these be made less complicated ?

  1. #1
    Forum Contributor
    Join Date
    08-10-2022
    Location
    Manchester
    MS-Off Ver
    2021
    Posts
    109

    Two Ridiculously Long Formulae - Can these be made less complicated ?

    I have two very long formulas.

    The first is in Cell N2 of my spreadsheet

    PHP Code: 
    =IF(A2="Six Day",(D2-TODAY())*(B8/365),IF(A2="Six Day 65 +",(D2-TODAY())*(B9/365),IF(A2="Six Day 70 +",(D2-TODAY())*(B10/365),IF(A2="Five Day",(D2-TODAY())*(B11/365),IF(A2="Three Day",(D2-TODAY())*(B12/365),IF(A2="Six Day 18 - 21",(D2-TODAY())*(B21/365),IF(A2="Six Day 22 - 24",(D2-TODAY())*(B22/365),IF(A2="Six Day 25 - 27",(D2-TODAY())*(B21/365),IF(A2="Six Day 28 - 30",(D2-TODAY())*(B20/365),IF(A2="Lady Six Day",(D2-TODAY())*(B15/365),IF(A2="Lady Six Day 65 - 69",(D2-TODAY())*(B13/365),IF(A2="Lady Six Day 70 +",(D2-TODAY())*(B14/365),IF(A2="Social",(D2-TODAY())*(B24/365),))))))))))))) 
    The second in Cell S2 is:

    PHP Code: 
    =(IF(A2="Men Six Day",B8/365,IF(A2="Men Six Day 65 - 69",B9/365,IF(A2="Men Six Day 70 +",B10/365,IF(A2="Five Day",B11/365,IF(A2="Three Day",B12/365,IF(A2="Six Day 28 - 30",B20/365,IF(A2="Six Day 25 - 27",B21/365,IF(A2="Six Day 22 - 24",B22/365,IF(A2="Six Day 18 - 21",B23/365,IF(A2="Social",B24/365,)))))))))))+IF(F2="YES",B25/365)+IF(G2="YES",B26/365

    Both of these work fine, but are long andpotentially open to errors.

    I have restructured this spreadsheet already to match my Excel knowledge ability, but welcome any advice on making it simpler. If it possible, could any explanation be provided on how the revised formula would work.

    Any other observations would be welcome. I've only just figured out Index/Match which I have used in C2
    Attached Files Attached Files

  2. #2
    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,063

    Re: Two Ridiculously Long Formulae - Can these be made less complicated ?

    N2 can become (I think):

    =(D2-TODAY())*VLOOKUP(A2,$A$5:$B$26,2,FALSE)/365
    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

  3. #3
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,435

    Re: Two Ridiculously Long Formulae - Can these be made less complicated ?

    N2: Please try

    =(D2-TODAY())*(INDEX(B5:B26,MATCH(A2,A5:A26,0))/365)

  4. #4
    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,063

    Re: Two Ridiculously Long Formulae - Can these be made less complicated ?

    and S2 can become:

    =(VLOOKUP(A2,$A$5:$B$26,2,FALSE)+IF(F2="Yes",B25,0)+IF(G2="Yes",B26,0))/365
    Attached Files Attached Files

  5. #5
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,435

    Re: Two Ridiculously Long Formulae - Can these be made less complicated ?

    or in S2 please try:

    =((F2="YES")*B25+(G2="YES")*B26+INDEX(B5:B26,MATCH(A2,A5:A26,0)))/365

  6. #6
    Forum Contributor
    Join Date
    08-10-2022
    Location
    Manchester
    MS-Off Ver
    2021
    Posts
    109

    Re: Two Ridiculously Long Formulae - Can these be made less complicated ?

    Thanks to you both. It will be tomorrow before I can try these out, but I'll come back to you then.

    I wanted to acknowledge and let you know I hadn't left you without response.

    I haven't figured out how to use VLookup yet. One more for the learning curve.

  7. #7
    Forum Contributor
    Join Date
    08-10-2022
    Location
    Manchester
    MS-Off Ver
    2021
    Posts
    109

    Re: Two Ridiculously Long Formulae - Can these be made less complicated ?

    Quote Originally Posted by HansDouwe View Post
    or in S2 please try:

    =((F2="YES")*B25+(G2="YES")*B26+INDEX(B5:B26,MATCH(A2,A5:A26,0)))/365
    Thanks very much. It works fine

  8. #8
    Forum Contributor
    Join Date
    08-10-2022
    Location
    Manchester
    MS-Off Ver
    2021
    Posts
    109

    Re: Two Ridiculously Long Formulae - Can these be made less complicated ?

    Quote Originally Posted by Glenn Kennedy View Post
    and S2 can become:

    =(VLOOKUP(A2,$A$5:$B$26,2,FALSE)+IF(F2="Yes",B25,0)+IF(G2="Yes",B26,0))/365
    Thanks for these two, they work great. In the end though I decided to go with Hans's solution. Simply because I understand how it works. I suspect VLOOKUP and INDEX/MATCH are very similar - the formula construction certainly is, but until I know that difference I'll use that one.

  9. #9
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,435

    Re: Two Ridiculously Long Formulae - Can these be made less complicated ?

    You are welcome.
    Thanks for your feedback and rep . Glad to have helped.

+ 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] Complicated Nested formulae using IF , AND , OR...
    By CDandVinyl in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-10-2020, 02:00 PM
  2. [SOLVED] Complicated Nested formulae using IF , AND , OR...
    By CDandVinyl in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-26-2020, 10:32 PM
  3. Replies: 2
    Last Post: 06-07-2017, 06:07 AM
  4. Replies: 2
    Last Post: 05-22-2013, 05:39 PM
  5. its complicated to explain see the tables i made :)
    By stratos2121 in forum Excel General
    Replies: 11
    Last Post: 04-21-2013, 02:21 AM
  6. Ridiculously long calculation time
    By dbconfession in forum Excel General
    Replies: 1
    Last Post: 09-14-2009, 01:15 AM
  7. Help Complicated formulae between columns
    By Bohk in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-02-2009, 12:35 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