+ Reply to Thread
Results 1 to 7 of 7

Dynamic formulas IF/LOOKUP?

  1. #1
    Registered User
    Join Date
    09-02-2013
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2013
    Posts
    44

    Dynamic formulas IF/LOOKUP?

    Hi!

    I will have excel to calculate the percent change between to values where an improvement is always shown as a positive value and a decline is always shown as a negative value. My problem is that I want excel to calculate this between the to latest values only i.e. if column J is blank, calculate with column I and H etc. also if a player misses a test and column J is blank but so is column H, then it would be really nice if excel could use the data from I and G.

    I have absolutely no idea how to write a dynamic formula like this. I am familiar with IF formulas but I couldn't find a way for that to work :/

    Anyone able to help me? I attached a simple workbook with some numbers to calculate on.

    Thanks!

    Markus
    Attached Files Attached Files

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,911

    Re: Dynamic formulas IF/LOOKUP?

    can you tell me the expected result manually

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Dynamic formulas IF/LOOKUP?

    hi anghicole. try this array formula:
    =LOOKUP(2,1/(D2:N2<>""),D2:N2)-INDEX(D2:N2,LARGE(IF(D2:N2<>"",COLUMN(D2:N2)),2)-COLUMN(D2)+1)

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    and change all my commas to semicolons if your separators are the latter

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Registered User
    Join Date
    09-02-2013
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2013
    Posts
    44

    Re: Dynamic formulas IF/LOOKUP?

    benishiryo that seems to work perfectly well thank you so much!!

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Dynamic formulas IF/LOOKUP?

    Hi,

    I would've thought the percentage increase/decrease should be measured viz:

    (Latest Score-Previous Score)/Previous Score

    Non-array alternative to do this (in O2 and copy down):

    =SUMPRODUCT(N(OFFSET(D2,,LARGE(INDEX((D2:N2<>"")*(COLUMN(D2:N2)-MIN(COLUMN(D2:N2))),,),{1,2}),,))*{1,-1})/OFFSET(D2,,LARGE(INDEX((D2:N2<>"")*(COLUMN(D2:N2)-MIN(COLUMN(D2:N2))),,),2),,)

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  6. #6
    Registered User
    Join Date
    09-02-2013
    Location
    Oslo, Norway
    MS-Off Ver
    Excel 2013
    Posts
    44

    Re: Dynamic formulas IF/LOOKUP?

    XOR LX, you're totally right! I did get some strange percentages on some of the results. Your formula works perfect, and with a correct calculation of the percentages! Thank you so much for the quick correction!!

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Dynamic formulas IF/LOOKUP?

    You're welcome!

+ 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. Insert cells, fill formulas down, set formulas for dynamic range
    By Snickers65 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2013, 01:43 PM
  2. Replies: 5
    Last Post: 09-25-2013, 02:51 PM
  3. [SOLVED] VBA to enter various formulas every 10 rows and show dynamic formulas not values
    By faby2203 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-04-2013, 07:05 AM
  4. Dynamic formulas
    By gtorres in forum Excel General
    Replies: 4
    Last Post: 03-22-2007, 02:04 PM
  5. Dynamic Formulas with Dynamic Ranges
    By Ralph Howarth in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-21-2005, 05:06 AM

Tags for this Thread

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