Spreadsheet: 758404d1638851014-max-of-series-in-one-column-depending-on-blank-non-blank-in-another-column-recent-highs
Sheet: Sheet1

 | S&P US | Date Conversion | 1D Return | Peaks | Post WW2 Peak (running) | Perf Since Peak | Valley Trough (running) | Troughs | Bears | Bulls | Post-Trough Peak (running) | Perf Since Post-Trough Peak | Day Count
10/23/1945 | 16.58 | 16733 | -0.007779772591262835 |  | 16.72 | -0.00837320574162683 | 16.33 |  | Bear |  |  |  | 38
[NAME] | 16.33 | 16734 | -0.01507840772014479 |  | 16.72 | -0.02332535885167468 | 16.33 | Trough |  |  |  |  | 39
10/25/1945 | 16.41 | 16735 | 0.004898958971218725 |  | 16.72 | -0.01854066985645925 | 16.33 |  |  | Bull |  |  | 40
10/26/1945 | 16.49 | 16736 | 0.004875076173065152 |  | 16.72 | -0.01375598086124405 | 16.33 |  |  | Bull |  |  | 41
10/29/1945 | 16.36 | 16739 | -0.007883565797452974 |  | 16.72 | -0.02153110047846887 | 16.33 |  |  | Bull |  |  | 42
10/30/1945 | 16.38 | 16740 | 0.001222493887530485 |  | 16.72 | -0.02033492822966506 | 16.33 |  |  | Bull |  |  | 43
10/31/1945 | 16.65 | 16741 | 0.01648351648351642 |  | 16.72 | -0.004186602870813415 | 16.33 |  |  | Bull |  |  | 44
11/01/1945 | 16.87 | 16742 | 0.01321321321321345 | Peak | 16.87 | 0 | 16.86 |  |  |  |  |  | 45
11/02/1945 | 16.86 | 16743 | -0.0005927682276231083 |  | 16.87 | -0.0005927682276230921 | 16.86 | Trough |  |  |  |  | 46
11/05/1945 | 16.94 | 16746 | 0.004744958481613493 | Peak | 16.94 | 0 | 16.94 |  |  |  |  |  | 47
11/06/1945 | 16.94 | 16747 | 0 |  | 16.94 | 0 | 16.94 | Trough |  |  |  |  | 48
11/07/1945 | 17.14 | 16748 | 0.0118063754427391 | Peak | 17.14 | 0 | 16.95 |  |  |  |  |  | 49
11/08/1945 | 17.08 | 16749 | -0.003500583430571913 |  | 17.14 | -0.003500583430571894 | 16.95 |  | Bear |  |  |  | 50
11/09/1945 | 17.1 | 16750 | 0.001170960187353742 |  | 17.14 | -0.002333722287047792 | 16.95 |  | Bear |  |  |  | 51
11/12/1945 | 17.1 | 16753 | 0 |  | 17.14 | -0.002333722287047792 | 16.95 |  | Bear |  |  |  | 52
11/13/1945 | 17.04 | 16754 | -0.003508771929824683 |  | 17.14 | -0.005834305717619686 | 16.95 |  | Bear |  |  |  | 53
11/14/1945 | 16.95 | 16755 | -0.005281690140845008 |  | 17.14 | -0.01108518086347732 | 16.95 | Trough |  |  |  |  | 54
11/15/1945 | 17.08 | 16756 | 0.007669616519174083 |  | 17.14 | -0.003500583430571894 | 16.95 |  |  | Bull |  |  | 55
11/16/1945 | 17.21 | 16757 | 0.007611241217798659 | Peak | 17.21 | 0 | 17.19 |  |  |  |  |  | 56
11/19/1945 | 17.19 | 16760 | -0.0011621150493899 |  | 17.21 | -0.001162115049389865 | 17.19 | Trough |  |  |  |  | 57
11/20/1945 | 17.27 | 16761 | 0.004653868528214034 | Peak | 17.27 | 0 | 16.85 |  |  |  |  |  | 58
11/21/1945 | 17.02 | 16762 | -0.01447596988998268 |  | 17.27 | -0.01447596988998263 | 16.85 |  | Bear |  |  |  | 59
11/22/1945 | 17.02 | 16763 | 0 |  | 17.27 | -0.01447596988998263 | 16.85 |  | Bear |  |  |  | 60
11/23/1945 | 16.85 | 16764 | -0.00998824911868379 |  | 17.27 | -0.02431962941517071 | 16.85 | Trough |  |  |  |  | 61
11/26/1945 | 16.94 | 16767 | 0.005341246290801127 |  | 17.27 | -0.01910828025477697 | 16.85 |  |  | Bull |  |  | 62
11/27/1945 | 17.15 | 16768 | 0.01239669421487588 |  | 17.27 | -0.00694846554719172 | 16.85 |  |  | Bull |  |  | 63
11/28/1945 | 17.06 | 16769 | -0.005247813411078717 |  | 17.27 | -0.01215981470758546 | 16.85 |  |  | Bull |  |  | 64
11/29/1945 | 17.03 | 16770 | -0.001758499413833436 |  | 17.27 | -0.01389693109438323 | 16.85 |  |  | Bull |  |  | 65
11/30/1945 | 17.19 | 16771 | 0.009395184967704084 |  | 17.27 | -0.004632310364794343 | 16.85 |  |  | Bull |  |  | 66
12/03/1945 | 17.44 | 16774 | 0.01454333915066908 | Peak | 17.44 | 0 | 17.41 |  |  |  |  |  | 67
12/04/1945 | 17.42 | 16775 | -0.001146788990825653 |  | 17.44 | -0.001146788990825664 | 17.41 |  | Bear |  |  |  | 68
12/05/1945 | 17.41 | 16776 | -0.0005740528128588274 |  | 17.44 | -0.001720183486238597 | 17.41 | Trough |  |  |  |  | 69
12/06/1945 | 17.5 | 16777 | 0.005169442848937278 | Peak | 17.5 | 0 | 17.5 |  |  |  |  |  | 70
12/07/1945 | 17.54 | 16778 | 0.002285714285714224 | Peak | 17.54 | 0 | 17.54 |  |  |  |  |  | 71