+ Reply to Thread
Results 1 to 15 of 15

Update of iferror lookup formula by adding max formula

  1. #1
    Registered User
    Join Date
    06-15-2021
    Location
    Malta
    MS-Off Ver
    365
    Posts
    24

    Update of iferror lookup formula by adding max formula

    Hello.

    a while ago you helped me to make work out a formula and until now everything was working great, but a new variable came up.

    I am attaching an example of a file with the old formula. What I would need to do is that in the cells that are highlighted in orange the result would not be the one from the last column where there is a value, but the highest one from the above 60.

    So the formula more or less should be like this: If the value is below 60 take the last one (so if there are 5 columns and in all 5 there are values, take the one from column five), if the value is over 60 take the higher one of them all.

    I tried adding the max formula, but I think I am adding it in the wrong place or maybe the formula used is not suited anymore for this.

    I highlighted in green the value that should be in the final result column.

    If there is anything unclear please let me know.

    In advance I already appreciate your help!
    Attached Files Attached Files

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.85 (24051214))
    Posts
    8,814

    Re: Update of iferror lookup formula by adding max formula

    IGNORE
    I have not considered the EXM in the header row

    off the top of my head
    =IFERROR(MAX(LOOKUP(2,1/((ISNUMBER(FIND("EXM",$B$1:$I$1)))*($B2:$I2<>"")*COLUMN($B2:$I2)),$B2:$I2),MAXIFS(B2:I2,B2:I2,">"&60)),"")

    BUT i'm sure it can be simplified with just a MAXIFS or ....- i will look into

    BUT you are only looking in columns with EXM in the header - which in your example they all have

    so it maybe a lot more complicated then i have shown
    Attached Files Attached Files
    Last edited by etaf; 06-09-2022 at 09:17 AM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,545

    Re: Update of iferror lookup formula by adding max formula

    Cell J2 array formula , Drag down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-15-2021
    Location
    Malta
    MS-Off Ver
    365
    Posts
    24

    Re: Update of iferror lookup formula by adding max formula

    @etaf, you are completely right. My apologies. I forgot to add to the example the columns of date and attendance. However it seems that @wk9128 formula works well.
    Let me try it on the original file and come back to you both.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-15-2021
    Location
    Malta
    MS-Off Ver
    365
    Posts
    24

    Re: Update of iferror lookup formula by adding max formula

    The formula seems to work, the only thing is that it does not consider the blanks. In the previous formula, when there was a blank cell the result was still a blank cell and not 0. Here it turns back '0'. so if there are no values in the row, the final result should remain blank instead of zero. What part of the previous formula did that?

    so (old): =IFERROR(LOOKUP(2,1/((ISNUMBER(FIND("EXM",$D$1:$Q$1)))*($D10:$Q10<>"")*COLUMN($D10:$Q10)),$D10:$Q10),"")

    vs (new): =MAX(IF((ISNUMBER(FIND("EXM",$B$1:$Q$1))*--ISNUMBER(--B10:Q10)),B10:Q10))

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,732

    Re: Update of iferror lookup formula by adding max formula

    Try the following formula that is activated by pressing just the Enter key:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,545

    Re: Update of iferror lookup formula by adding max formula

    ANS. Post#4

    For 365

    Cell R2 formula , Drag down

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


    other version option

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by wk9128; 06-11-2022 at 09:44 PM.

  8. #8
    Registered User
    Join Date
    06-15-2021
    Location
    Malta
    MS-Off Ver
    365
    Posts
    24

    Re: Update of iferror lookup formula by adding max formula

    Thank you both for your replies.
    I am attaching once again the file with all the possible variables. I made only one change there as I noticed that the formula was not working properly in all cases (in the original file).
    I copied one original entry (Rowena) to see if it works in this test file and it works, however it does not in the original one (as in some other cases), so will have to look into it why it gives me random numbers instead of the 67.5.

    What I did in this updated file is:
    - I added a blank row and a pending row, but no new columns.
    - Column R with Final Result has the old formula. This one does not include the max option when the grade is above 60 (see cells in orange).
    - Column S has the new formula provided by you. This one seems to work (cells in green are correct vs cells in orange with the old formula) and it now also considers the blanks (meaning it leaves the blank as blank, not 0 - for example case of Ivana), however: when there is written n/a as the last result the formula ignores it instead of considering it as last result. same with 'pending' (cells in red).

    So, in other words:
    - When the first result is blank leave the Final result blank
    - When the result or results are below 60, take the last one (exm 1, 2, 3, 4)
    - When the result or results are above 60, take highest one
    - if the last result is n/a or pending put this word in the Final result column

    I apologise for the confusion and for not placing this file from the beginning. I discovered the other variables when testing the formula.

    If there is anything unclear please let me know.
    Attached Files Attached Files
    Last edited by Jasminia; 06-14-2022 at 06:49 AM.

  9. #9
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,545

    Re: Update of iferror lookup formula by adding max formula

    Hi Jasminia

    Please show the final result you want in the attachment and place a column. We will find a way to formulate the formula. It looks very confusing at present.

  10. #10
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,445

    Re: Update of iferror lookup formula by adding max formula

    Yes, very confusing!

    This, maybe?

    =MAX(IF((LEFT($D$1:$Q$1,3)="EXM")*(LEN($D$1:$Q$1)=5),D2:Q2))
    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.

  11. #11
    Registered User
    Join Date
    06-15-2021
    Location
    Malta
    MS-Off Ver
    365
    Posts
    24

    Re: Update of iferror lookup formula by adding max formula

    Thank you for replying and sorry for the confusion.
    I left the old formula and the one provided here and also added a column with the desired result. The last row which is blank must remain blank.

    I hope this helps.
    Attached Files Attached Files

  12. #12
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,545

    Re: Update of iferror lookup formula by adding max formula

    Cell T2 formula , Drag down
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    OR

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by wk9128; 06-17-2022 at 04:54 AM.

  13. #13
    Registered User
    Join Date
    06-15-2021
    Location
    Malta
    MS-Off Ver
    365
    Posts
    24

    Re: Update of iferror lookup formula by adding max formula

    Thank you very much @wk912 for your effort!
    The formula almost works. In all the rows it gives the desired result except in the last one, because it turns back a '0' instead of a blank. Is it possible to adjust it? I tried adding the "", but it gives me back the notification that too many arguments have been added.
    I am still figuring out how to make it work in the original file, but will get back on that after the weekend.

  14. #14
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,545

    Re: Update of iferror lookup formula by adding max formula

    Hi Jasminia Post#12 A new formula is added, does that mean?

  15. #15
    Registered User
    Join Date
    06-15-2021
    Location
    Malta
    MS-Off Ver
    365
    Posts
    24

    Re: Update of iferror lookup formula by adding max formula

    Thank you wk9128. I checked the formula in the test file I provided and it works perfectly!
    However when transferring the formula into the original file it gives me very high numbers (like it's adding everything) and the only information that changes (between the test and original file) is this:
    LET(a,$D$1:$Q$1,b,$D2:$Q2 - meaning the column number, nothing else (of course I changed them). so for example instead of giving me a result of 62.5 it gives 875 or over 900 or a blank. not sure what could be the reason. Any ideas what can I check?
    Last edited by Jasminia; 06-20-2022 at 07:26 AM.

+ 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] Adding IFERROR Statement to a Formula
    By smw10c in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2019, 08:36 AM
  2. [SOLVED] Adding IFERROR to a formula help
    By MattExcelLearner in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-25-2018, 03:51 AM
  3. [SOLVED] Adding IfError To RC Format Formula
    By jo15765 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-25-2017, 09:51 PM
  4. [SOLVED] Adding IFERROR to a formula to get rid of #####
    By Hedy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-08-2016, 03:24 PM
  5. [SOLVED] Help on adding an IFERROR/IF function to an existing formula.
    By Albert Dirk in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-23-2016, 07:16 AM
  6. [SOLVED] Adding IFERROR IF MATCH Formula to each row
    By MICowboy13 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-15-2014, 02:47 PM
  7. Help adding Iferror to existing formula
    By rwmeis in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-27-2013, 12:33 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