Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-09-2024, 12:47 PM
oscarlimerick oscarlimerick is offline look up and display last max value in a column Windows 8 look up and display last max value in a column Office 2013
Advanced Beginner
look up and display last max value in a column
 
Join Date: Jul 2020
Posts: 57
oscarlimerick is on a distinguished road
Default look up and display last max value in a column

Good day Excel experts. I have attached an example spreadsheet. It is a spreadsseet I intend to update daily with the date being column A, and a given numerical value in column B. What I want to do here is have the spreadhseet display in cell E5, the LAST maximum value in column B, and the corresponding date of that value in cell G5. Obviously using "=max(b:b)" in cell E5 will return the value 50 as this is the maximum numerical value in column B, but I want the spreadsheet to look up and display in cell E5, the last maximum value in column B,which in my example spreadsheet can be found in cell B15, or 26. Then I want to know what formula to use in cell G5 to return the date when this value occured, or 2024-01-11, as in cell A15.

Then each day as the list is updated, I want the values in cell E5 and G5 to recalculate and display the last occurring maximum value that is in column B, based on the date, so it should look back and find the previous date with the maximum value of column B and display that If the current cell on a given date is equal to or already the maximum value in column B, then display that value and date in E5 and G5. Please let me know if any questions, and thanks for your help and suggestions
Attached Files
File Type: xlsx EXCEL FORUM EXAMPLE.xlsx (9.7 KB, 4 views)
Reply With Quote
  #2  
Old 01-09-2024, 08:41 PM
Logit Logit is offline look up and display last max value in a column Windows 10 look up and display last max value in a column Office 2007
Expert
 
Join Date: Jan 2017
Posts: 533
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

How have you determined that B15 (26) is the last max value ?
Reply With Quote
  #3  
Old 01-09-2024, 10:06 PM
oscarlimerick oscarlimerick is offline look up and display last max value in a column Windows 8 look up and display last max value in a column Office 2013
Advanced Beginner
look up and display last max value in a column
 
Join Date: Jul 2020
Posts: 57
oscarlimerick is on a distinguished road
Default

Because on the last date entered so far Jan 14, the value is 21. So if I start looking back, on the previous date, Jan 13, the value is 9, so this is less that 21. Then on Jan 12 the value is 13, also less than 21. But... on Jan 11, the value was 26, which is greater than 21, so I want to capture this 21 value in cell E5, along with the date Jan 11 in cell G5.

As I enter more dates and values for each date, I want excel to compare the current score value in cloumn B, with the previous cells, and work its way up to where it finds a value greater than the current value in column B. Hope that makes sense
Reply With Quote
  #4  
Old 01-10-2024, 12:04 AM
Logit Logit is offline look up and display last max value in a column Windows 10 look up and display last max value in a column Office 2007
Expert
 
Join Date: Jan 2017
Posts: 533
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

This will require a strong formula. Regretfully, formulas are not my strong suite.

Can someone else with a good knowledge of formulas please step in and assist ?
Thank you !
Reply With Quote
  #5  
Old 01-10-2024, 12:12 AM
ArviLaanemets ArviLaanemets is offline look up and display last max value in a column Windows 8 look up and display last max value in a column Office 2016
Expert
 
Join Date: May 2017
Posts: 873
ArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud of
Default

So what you really want, is the last value greater than current one. The max previous value can be somewhere before Jan 11.
Another thing is, you are speaking about dates, but you are checking row-wise. What is 'previous' for you - the previous date, or previous row. What happens when the table is rearranged (sorted) by some other column. In case you check not date-wise, but row-wise, your formula's results most probably will be entirely different.
Reply With Quote
  #6  
Old 01-10-2024, 08:38 AM
p45cal's Avatar
p45cal p45cal is offline look up and display last max value in a column Windows 10 look up and display last max value in a column Office 2021
Expert
 
Join Date: Apr 2014
Posts: 871
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Looks like you're still on Excel 2013; can you confirm?

If so, then this is not straightforward. I've put together one solution, but it's not great. If I think of a better solution I'll post again.
So, in cell E5:
Code:
=INDEX(B5:B1000,MATCH(MAX(IF(B5:B1000>INDEX(B5:B1000,MAX((B5:B1000<>"")*(ROW(B5:B1000)))-ROW(B5)+1),ROW(B5:B1000))),IF(B5:B1000>INDEX(B5:B1000,MAX((B5:B1000<>"")*(ROW(B5:B1000)))-ROW(B5)+1),ROW(B5:B1000)),0))
which should be entered onto the sheet using Ctrl+Shift+Enter, not just plain Enter (called array-entering).

A slight variant, array-entered into cell G5 to give the date:
Code:
=INDEX(A5:A1000,MATCH(MAX(IF(B5:B1000>INDEX(B5:B1000,MAX((B5:B1000<>"")*(ROW(B5:B1000)))-ROW(B5)+1),ROW(B5:B1000))),IF($B$5:$B1000>INDEX(B5:B1000,MAX((B5:B1000<>"")*(ROW(B5:B1000)))-ROW(B5)+1),ROW(B5:B1000)),0))
Note that as @ArviLaanements pointed out, this one uses previous row, not previous date.

Also, it currently looks only at rows 5 to 1000, you need to adjust it if you need more rows (or fewer too, perhaps).
Note that it depends on there being all empty cells in that range in column B below the last score.

If you're on Office 365 the formula can be much shorter.

See attached.
Attached Files
File Type: xlsx msofficeforums51894EXCEL FORUM EXAMPLE.xlsx (10.6 KB, 5 views)

Last edited by p45cal; 01-10-2024 at 04:27 PM.
Reply With Quote
  #7  
Old 01-10-2024, 12:09 PM
oscarlimerick oscarlimerick is offline look up and display last max value in a column Windows 8 look up and display last max value in a column Office 2013
Advanced Beginner
look up and display last max value in a column
 
Join Date: Jul 2020
Posts: 57
oscarlimerick is on a distinguished road
Default

Quote:
Originally Posted by ArviLaanemets View Post
So what you really want, is the last value greater than current one. The max previous value can be somewhere before Jan 11.
Another thing is, you are speaking about dates, but you are checking row-wise. What is 'previous' for you - the previous date, or previous row. What happens when the table is rearranged (sorted) by some other column. In case you check not date-wise, but row-wise, your formula's results most probably will be entirely different.
You are correct, the max value can be before Jan 11 and is in my example, but the defining criteria I am interested in capturing the last max value, which is cell B15 or 26. So to answer, I dont intend to sort any of the columns, and I dont really want to check row wise, I want to check by the date and display the last max value as well as the date it occured. Thanks
Reply With Quote
  #8  
Old 01-10-2024, 12:12 PM
oscarlimerick oscarlimerick is offline look up and display last max value in a column Windows 8 look up and display last max value in a column Office 2013
Advanced Beginner
look up and display last max value in a column
 
Join Date: Jul 2020
Posts: 57
oscarlimerick is on a distinguished road
Default

Unfortunately I am still using excel 2013. Thganks for the suggestion, I will try it out and reply whether it worked for me or not
Reply With Quote
  #9  
Old 01-10-2024, 06:35 PM
p45cal's Avatar
p45cal p45cal is offline look up and display last max value in a column Windows 10 look up and display last max value in a column Office 2021
Expert
 
Join Date: Apr 2014
Posts: 871
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Quote:
Originally Posted by oscarlimerick View Post
I dont really want to check row wise, I want to check by the date
Try array-entering in cell G5:
Code:
=MAX(IF(((A5:A1000<INDEX(A5:A1000,MATCH(MAX(A5:A1000),A5:A1000,0)))*(B5:B1000>INDEX(B5:B1000,MATCH(MAX(A5:A1000),A5:A1000,0)))),A5:A1000))
and in cell E5:
Code:
=INDEX(B5:B1000,MATCH(G5,A5:A1000,0))
No dates with with no score.
Reply With Quote
  #10  
Old 01-11-2024, 12:44 PM
oscarlimerick oscarlimerick is offline look up and display last max value in a column Windows 8 look up and display last max value in a column Office 2013
Advanced Beginner
look up and display last max value in a column
 
Join Date: Jul 2020
Posts: 57
oscarlimerick is on a distinguished road
Default

Hello, I havent tried some of the previous suggestions yet, but I did try this one (I entered both formulas as instructed) and it didn't work unfortunately. These formulas retuned a value of #N/A in cell E5 and a 0 value in cell G5. Did these formaulas work for you? Maybe I'm doing something else wrong or missing a step? Do I need to do anything special to enter the formulas? I just copied and pasted them ion to E5 and G5. Thanks
Reply With Quote
  #11  
Old 01-11-2024, 02:36 PM
Logit Logit is offline look up and display last max value in a column Windows 10 look up and display last max value in a column Office 2007
Expert
 
Join Date: Jan 2017
Posts: 533
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

His last suggested solution works here.
Reply With Quote
  #12  
Old 01-11-2024, 04:29 PM
oscarlimerick oscarlimerick is offline look up and display last max value in a column Windows 8 look up and display last max value in a column Office 2013
Advanced Beginner
look up and display last max value in a column
 
Join Date: Jul 2020
Posts: 57
oscarlimerick is on a distinguished road
Default

You are correct, this solution does work, I just need to follow instructions better. I need to do an array enter for cell G% for this towork properly, I missed that the first time. Now I just need to go thru the fornulas and figure out how and why they work. Many thanks to all who provided suggested solution(s). I will close out the thread now
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Display of predecessor and successor column tropaj Project 3 04-03-2022 04:12 PM
look up and display last max value in a column display a change in column cells counting the number of months oscarlimerick Excel 4 03-14-2022 12:22 AM
look up and display last max value in a column Display an additional date column in Gantt chart ds1 Project 4 04-17-2017 01:34 PM
look up and display last max value in a column Embedded Excel in Powerpoint - custom animation, display column by column andytheanimal PowerPoint 2 01-20-2015 06:30 AM
Excel Fomula to search for a string and display value from different column zeeshanbutt Excel 1 07-29-2012 12:48 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft