Solved

Record values from one column based on those in another column

Posted on 2014-10-07
4
121 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
  • 2
  • 2
4 Comments
 
LVL 27

Assisted Solution

by:Glenn Ray
Glenn Ray earned 500 total points
Comment Utility
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
Comment Utility
Works perfect. Thanks Glenn.
0
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 500 total points
Comment Utility
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
Comment Utility
Fantastic! Yes, 180 days after the max works just fine. Many thanks!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now