?
Solved

Record values from one column based on those in another column

Posted on 2014-10-07
4
Medium Priority
?
139 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 2000 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

752 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