Getting value from a different tab (How to make my current formula drag down?)

britts614

New Member
Joined
Jul 9, 2019
Messages
8
Hello!

I made a formula to display the latest value entered in a column on a different tab.


In the column on “Sheet2,” an employee enters the new amount of mileage driven in the rented car once it’s returned (see example below. Date and Mileage are two different columns):



  • “Date”..................... “Mileage”
  • 01/01/2019............... 123,456
  • 01/05/2019 ...............123,557
  • 01/27/2019 ...............124,896
On the “Sheet1” page it displays the most recent mileage count ("124,896") using the formula below:

<code>=LOOKUP(2,1/(Sheet2!H2:H10000<>""),Sheet2!H2:H10000)

</code>The thing is, I have 5 different sheets with the same two columns as above and I need to use this formula to get the mileage values from all 5 sheets. As of now I am entering it manually in each cell to say "Sheet3!" or "Sheet4!" to gather the data.



Is there a way I can create a drag down formula instead of manually entering the different sheet names?

Thanks! :)
 

Eric W

MrExcel MVP
Joined
Aug 18, 2015
Messages
9,122
If you have a list of your sheet names, you can use INDIRECT like this:

<b></b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>N</th><th>O</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style=";">Sheet2</td><td style="text-align: right;;">3</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style=";">Sheet3</td><td style="text-align: right;;">55</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style=";">Sheet4</td><td style="text-align: right;;">222</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style=";">Sheet5</td><td style="text-align: right;;">6666</td></tr></tbody></table><p style="width:4.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">O1</th><td style="text-align:left">=LOOKUP(<font color="Blue">2,1/(<font color="Red">INDIRECT(<font color="Green">"'"&N1&"'!H2:H10000"</font>)<>""</font>),INDIRECT(<font color="Red">"'"&N1&"'!H2:H10000"</font>)</font>)</td></tr></tbody></table></td></tr></table><br />
 

Forum statistics

Threads
1,084,776
Messages
5,379,822
Members
401,629
Latest member
LEMANOIS

Some videos you may like

This Week's Hot Topics

Top