+ Reply to Thread
Results 1 to 8 of 8

IF Function optimisation

  1. #1
    Registered User
    Join Date
    02-08-2022
    Location
    Japan
    MS-Off Ver
    Office 365 proplus
    Posts
    20

    IF Function optimisation

    Dear all,

    the attached sheet is currently working well, but for a self improvement, I would like to have some recommendations on how to improve it/make it shorter, and thus have new inspirations for further works.

    Sheet explanation :
    B2:B4 looks up A2:A4 corresponding to F:F
    Puts "," every thousands
    links G and H to be "price 1 - price 2"
    adds JPY mark if B6 rate is 1.
    divides, rounds up and adds USD or EUR mark corresponding on the B6 rates.

    The current formula is :
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I am all open to suggestions.
    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,137

    Re: IF Function optimisation

    Maybe this:

    =LET(l,G2:G4,h,H2:H4,c,CHOOSE(LOOKUP($B$6,{1,100,121},{1,2,3}),1,$B$6,$B$6),z,LOOKUP($B$6,{1,100,121},{"¥","$","€"}),TEXT(ROUND(l/c,0),"#,##0")&z&" - "&TEXT(ROUND(h/c,0),"#,##0")&z)
    Attached Files Attached Files
    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

  3. #3
    Registered User
    Join Date
    02-08-2022
    Location
    Japan
    MS-Off Ver
    Office 365 proplus
    Posts
    20

    Re: IF Function optimisation

    Hi Glenn,

    Thank you for your quick response.

    It works and is very shorter, thank you very much for your time.


    (edit post does not show the post itself, making it impossible to edit. Could you please turn the post in solved for me?)

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,565

    Re: IF Function optimisation

    One way:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    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,137

    Re: IF Function optimisation

    Did I miss a bit... are they always in the same order... 1,2,3, in both places?

  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,137

    Re: IF Function optimisation

    If the orders are NOT the same:

    =LET(a,$B$6,r,G2:H4,l,INDEX(r,MATCH(A2:A4,F2:F4,0),1),h,INDEX(r,MATCH(A2:A4,F2:F4,0),2),c,CHOOSE(LOOKUP(a,{1,100,121},{1,2,3}),1,a,a),z,LOOKUP(a,{1,100,121},{"¥","$","€"}),TEXT(ROUND(l/c,0),"#,##0")&z&" - "&TEXT(ROUND(h/c,0),"#,##0")&z)

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.
    Attached Files Attached Files

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,565

    Re: IF Function optimisation

    Building on Glenn's solution, combined with mine:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,565

    Re: IF Function optimisation

    Thanks for the rep.

+ 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. How to solve such an optimisation problem?
    By andre199017 in forum Excel General
    Replies: 10
    Last Post: 01-19-2017, 01:37 PM
  2. optimisation
    By rtedesco in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-03-2016, 08:42 PM
  3. Workbook optimisation
    By tuph in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-05-2015, 04:31 PM
  4. Array slicing optimisation
    By Kyle123 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-01-2012, 10:43 AM
  5. Optimisation of code
    By munkee in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-17-2009, 10:26 AM
  6. optimisation tool for objective function macro
    By wjm in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-09-2006, 06:02 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