Might be best if you could provide an example, showing the data that is there, and what your expected result is.
Goal: I am ultimately trying to figure out how long until my retirement money runs out and at what age. I want this to be universal so that I can easily input my starting age and ending age without having to manipulate my data to show this graphically.
So Below are my numbers (I know they're a little messed up). Through several formulas, I have calculated my baseline which is the total amount in my retirement account. My baseline formula is =IF(AR3<$AP$3, I3,$W$3). W3 is referencing the total amount in my retirement account at the end of retirement. You contribute until you retire. So the formula needs to change but I can't simply change the formula every time because the number of years worked is different case by case. Therefore, W3 is held constant so it does not reference the total remaining balance until the IF function is false. However, I need it to reference W3, W4, W5, and so on as the equations move down the rows when the IF function is false. Is there a way to have the formula remove the constant without having to manually remove it in the formula? That is really the crux of my question.
[TABLE="width: 838"]
<colgroup><col><col><col><col span="2"><col></colgroup><tbody>[TR]
[TD] Row Age [/TD]
[TD] Total Remaining Balance [/TD]
[TD]# of Working Years[/TD]
[TD]Age[/TD]
[TD]Years worked[/TD]
[TD]Baseline[/TD]
[/TR]
[TR]
[TD="align: right"]3 62[/TD]
[TD] $ 686,606[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]1[/TD]
[TD] $ 4,220[/TD]
[/TR]
[TR]
[TD="align: right"] 4 63[/TD]
[TD] $ 651,977[/TD]
[TD][/TD]
[TD="align: right"]26[/TD]
[TD="align: right"]2[/TD]
[TD] $ 8,799[/TD]
[/TR]
[TR]
[TD="align: right"]64[/TD]
[TD] $ 615,963[/TD]
[TD][/TD]
[TD="align: right"]27[/TD]
[TD="align: right"]3[/TD]
[TD] $ 13,760[/TD]
[/TR]
[TR]
[TD="align: right"]65[/TD]
[TD] $ 578,509[/TD]
[TD][/TD]
[TD="align: right"]28[/TD]
[TD="align: right"]4[/TD]
[TD] $ 19,128[/TD]
[/TR]
[TR]
[TD="align: right"]66[/TD]
[TD] $ 539,557[/TD]
[TD][/TD]
[TD="align: right"]29[/TD]
[TD="align: right"]5[/TD]
[TD] $ 24,929[/TD]
[/TR]
[TR]
[TD="align: right"]67[/TD]
[TD] $ 499,046[/TD]
[TD][/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]6[/TD]
[TD] $ 31,193[/TD]
[/TR]
[TR]
[TD="align: right"]68[/TD]
[TD] $ 456,916[/TD]
[TD][/TD]
[TD="align: right"]31[/TD]
[TD="align: right"]7[/TD]
[TD] $ 37,947[/TD]
[/TR]
[TR]
[TD="align: right"]69[/TD]
[TD] $ 413,100[/TD]
[TD][/TD]
[TD="align: right"]32[/TD]
[TD="align: right"]8[/TD]
[TD] $ 45,224[/TD]
[/TR]
[TR]
[TD="align: right"]70[/TD]
[TD] $ 367,531[/TD]
[TD][/TD]
[TD="align: right"]33[/TD]
[TD="align: right"]9[/TD]
[TD] $ 53,057[/TD]
[/TR]
[TR]
[TD="align: right"]71[/TD]
[TD] $ 320,139[/TD]
[TD][/TD]
[TD="align: right"]34[/TD]
[TD="align: right"]10[/TD]
[TD] $ 61,482[/TD]
[/TR]
[TR]
[TD="align: right"]72[/TD]
[TD] $ 270,852[/TD]
[TD][/TD]
[TD="align: right"]35[/TD]
[TD="align: right"]11[/TD]
[TD] $ 70,535[/TD]
[/TR]
[TR]
[TD="align: right"]73[/TD]
[TD] $ 219,594[/TD]
[TD][/TD]
[TD="align: right"]36[/TD]
[TD="align: right"]12[/TD]
[TD] $ 80,255[/TD]
[/TR]
[TR]
[TD="align: right"]74[/TD]
[TD] $ 166,285[/TD]
[TD][/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]13[/TD]
[TD] $ 90,686[/TD]
[/TR]
[TR]
[TD="align: right"]75[/TD]
[TD] $ 110,843[/TD]
[TD][/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]14[/TD]
[TD] $ 101,871[/TD]
[/TR]
[TR]
[TD="align: right"]76[/TD]
[TD] $ 53,184[/TD]
[TD][/TD]
[TD="align: right"]39[/TD]
[TD="align: right"]15[/TD]
[TD] $ 113,857[/TD]
[/TR]
[TR]
[TD="align: right"]77[/TD]
[TD] $ (6,781)[/TD]
[TD][/TD]
[TD="align: right"]40[/TD]
[TD="align: right"]16[/TD]
[TD] $ 126,694[/TD]
[/TR]
[TR]
[TD="align: right"]78[/TD]
[TD] $ (69,145)[/TD]
[TD][/TD]
[TD="align: right"]41[/TD]
[TD="align: right"]17[/TD]
[TD] $ 140,434[/TD]
[/TR]
[TR]
[TD="align: right"]79[/TD]
[TD] $ (134,004)[/TD]
[TD][/TD]
[TD="align: right"]42[/TD]
[TD="align: right"]18[/TD]
[TD] $ 155,133[/TD]
[/TR]
[TR]
[TD="align: right"]80[/TD]
[TD] $ (201,456)[/TD]
[TD][/TD]
[TD="align: right"]43[/TD]
[TD="align: right"]19[/TD]
[TD] $ 170,849[/TD]
[/TR]
[TR]
[TD="align: right"]81[/TD]
[TD] $ (271,607)[/TD]
[TD][/TD]
[TD="align: right"]44[/TD]
[TD="align: right"]20[/TD]
[TD] $ 187,646[/TD]
[/TR]
[TR]
[TD="align: right"]82[/TD]
[TD] $ (344,564)[/TD]
[TD][/TD]
[TD="align: right"]45[/TD]
[TD="align: right"]21[/TD]
[TD] $ 205,588[/TD]
[/TR]
[TR]
[TD="align: right"]83[/TD]
[TD] $ (420,440)[/TD]
[TD][/TD]
[TD="align: right"]46[/TD]
[TD="align: right"]22[/TD]
[TD] $ 224,746[/TD]
[/TR]
[TR]
[TD="align: right"]84[/TD]
[TD] $ (499,350)[/TD]
[TD][/TD]
[TD="align: right"]47[/TD]
[TD="align: right"]23[/TD]
[TD] $ 245,193[/TD]
[/TR]
[TR]
[TD="align: right"]85[/TD]
[TD] $ (581,417)[/TD]
[TD][/TD]
[TD="align: right"]48[/TD]
[TD="align: right"]24[/TD]
[TD] $ 267,007[/TD]
[/TR]
[TR]
[TD="align: right"]86[/TD]
[TD] $ (666,766)[/TD]
[TD][/TD]
[TD="align: right"]49[/TD]
[TD="align: right"]25[/TD]
[TD] $ 290,271[/TD]
[/TR]
[TR]
[TD="align: right"]87[/TD]
[TD] $ (755,529)[/TD]
[TD][/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]26[/TD]
[TD] $ 315,072[/TD]
[/TR]
[TR]
[TD="align: right"]88[/TD]
[TD] $ (847,843)[/TD]
[TD][/TD]
[TD="align: right"]51[/TD]
[TD="align: right"]27[/TD]
[TD] $ 341,501[/TD]
[/TR]
[TR]
[TD="align: right"]89[/TD]
[TD] $ (943,850)[/TD]
[TD][/TD]
[TD="align: right"]52[/TD]
[TD="align: right"]28[/TD]
[TD] $ 369,658[/TD]
[/TR]
[TR]
[TD="align: right"]90[/TD]
[TD] $ (1,043,697)[/TD]
[TD][/TD]
[TD="align: right"]53[/TD]
[TD="align: right"]29[/TD]
[TD] $ 399,644[/TD]
[/TR]
[TR]
[TD="align: right"]91[/TD]
[TD] $ (1,147,537)[/TD]
[TD][/TD]
[TD="align: right"]54[/TD]
[TD="align: right"]30[/TD]
[TD] $ 431,569[/TD]
[/TR]
[TR]
[TD="align: right"]92[/TD]
[TD] $ (1,255,531)[/TD]
[TD][/TD]
[TD="align: right"]55[/TD]
[TD="align: right"]31[/TD]
[TD] $ 465,548[/TD]
[/TR]
[TR]
[TD="align: right"]93[/TD]
[TD] $ (1,367,845)[/TD]
[TD][/TD]
[TD="align: right"]56[/TD]
[TD="align: right"]32[/TD]
[TD] $ 501,704[/TD]
[/TR]
[TR]
[TD="align: right"]94[/TD]
[TD] $ (1,484,652)[/TD]
[TD][/TD]
[TD="align: right"]57[/TD]
[TD="align: right"]33[/TD]
[TD] $ 540,164[/TD]
[/TR]
[TR]
[TD="align: right"]95[/TD]
[TD] $ (1,606,131)[/TD]
[TD][/TD]
[TD="align: right"]58[/TD]
[TD="align: right"]34[/TD]
[TD] $ 581,066[/TD]
[/TR]
[TR]
[TD="align: right"]96[/TD]
[TD] $ (1,732,468)[/TD]
[TD][/TD]
[TD="align: right"]59[/TD]
[TD="align: right"]35[/TD]
[TD] $ 624,554[/TD]
[/TR]
[TR]
[TD="align: right"]97[/TD]
[TD] $ (1,863,860)[/TD]
[TD][/TD]
[TD="align: right"]60[/TD]
[TD="align: right"]36[/TD]
[TD] $ 670,779[/TD]
[/TR]
[TR]
[TD="align: right"]98[/TD]
[TD] $ (2,000,507)[/TD]
[TD][/TD]
[TD="align: right"]61[/TD]
[TD="align: right"]37[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD="align: right"]99[/TD]
[TD] $ (2,142,620)[/TD]
[TD][/TD]
[TD="align: right"]62[/TD]
[TD="align: right"]38[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD="align: right"]100[/TD]
[TD] $ (2,290,418)[/TD]
[TD][/TD]
[TD="align: right"]63[/TD]
[TD="align: right"]39[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD="align: right"]101[/TD]
[TD] $ (2,444,127)[/TD]
[TD][/TD]
[TD="align: right"]64[/TD]
[TD="align: right"]40[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]65[/TD]
[TD="align: right"]41[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]66[/TD]
[TD="align: right"]42[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]67[/TD]
[TD="align: right"]43[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]68[/TD]
[TD="align: right"]44[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]69[/TD]
[TD="align: right"]45[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]70[/TD]
[TD="align: right"]46[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]71[/TD]
[TD="align: right"]47[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]72[/TD]
[TD="align: right"]48[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]73[/TD]
[TD="align: right"]49[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]74[/TD]
[TD="align: right"]50[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]75[/TD]
[TD="align: right"]51[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]76[/TD]
[TD="align: right"]52[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]77[/TD]
[TD="align: right"]53[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]78[/TD]
[TD="align: right"]54[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]79[/TD]
[TD="align: right"]55[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]80[/TD]
[TD="align: right"]56[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]81[/TD]
[TD="align: right"]57[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]82[/TD]
[TD="align: right"]58[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]83[/TD]
[TD="align: right"]59[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]84[/TD]
[TD="align: right"]60[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]85[/TD]
[TD="align: right"]61[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]86[/TD]
[TD="align: right"]62[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]87[/TD]
[TD="align: right"]63[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]88[/TD]
[TD="align: right"]64[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]89[/TD]
[TD="align: right"]65[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]90[/TD]
[TD="align: right"]66[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]91[/TD]
[TD="align: right"]67[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]92[/TD]
[TD="align: right"]68[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]93[/TD]
[TD="align: right"]69[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]94[/TD]
[TD="align: right"]70[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]95[/TD]
[TD="align: right"]71[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]96[/TD]
[TD="align: right"]72[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]97[/TD]
[TD="align: right"]73[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]98[/TD]
[TD="align: right"]74[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]99[/TD]
[TD="align: right"]75[/TD]
[TD] $ 686,606[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]76[/TD]
[TD] $ 686,606[/TD]
[/TR]
</tbody>[/TABLE]