Solved

Record values from one column based on those in another column

Posted on 2014-10-07
4
132 Views
Last Modified: 2014-10-07
The attached Excel workbook includes the data that corresponds with the two calculation needs associated with this question:

1) Need to fill Column C of the "ResultsTable" sheet with the day of year (DOY; in Column F of the "Data" sheet) that corresponds with the max depth for that year.  If two DOY's have the same max depth, return the largest of the two DOY's

2) Need to fill Column D with the DOY that corresponds with the first zero value encountered subsequent to the value derived in Column C.

I manually populated the correct values for AllSeasYear = 1993.

Is there a good way to automate this with Excel functions?
OriginalDataFile.xlsx
0
Comment
Question by:dougf1r
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 27

Assisted Solution

by:Glenn Ray
Glenn Ray earned 500 total points
ID: 40366889
The MaxDepthDOY value can be found with this formula (in C2, copied down):
=INDEX(OFFSET(Data!F1,MATCH(A2,Data!E:E,0)-1,0,COUNTIF(Data!E:E,A2)),MATCH(B2,OFFSET(Data!J1,MATCH(A2,Data!E:E,0)-1,0,COUNTIF(Data!E:E,A2),1),0))

Still working on the second one...

-Glenn
0
 
LVL 1

Author Comment

by:dougf1r
ID: 40366954
Works perfect. Thanks Glenn.
0
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 500 total points
ID: 40367001
Here's the formula for the first zero depth day after the Maximum - in cell D2, copied down (deep breath):
=OFFSET(Data!$F$1,MATCH(A2,Data!E:E,0)+MATCH(C2,OFFSET(Data!$F$1,MATCH(A2,Data!E:E,0)-1,0,COUNTIF(Data!E:E,A2),1),0)-1+MATCH(0,OFFSET(Data!$J$1,MATCH(A2,Data!E:E,0)+MATCH(C2,OFFSET(Data!$F$1,MATCH(A2,Data!E:E,0)-1,0,COUNTIF(Data!E:E,A2),1),0)-2,0,180,1),0)-2,)

To simplify things (no, really), the formula is only looking ahead 180 days after the max; seems to work.  My gut tells me this might be made a bit simpler, but I'm inclined to leave it be.

Regards,
-Glenn
0
 
LVL 1

Author Comment

by:dougf1r
ID: 40367123
Fantastic! Yes, 180 days after the max works just fine. Many thanks!
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question