0
votes

Hi Need help to refer a range to a cell value (which has the range).

QUESTION: How to refer the range to a cell in J84 for B86:B146 and cell J85 for D:I using INDIRECT?

Here's my current formula:

={"HOURS"; 
 ARRAYFORMULA(IFNA(IF(VLOOKUP(B86:B146, Sheet1!D:I, 6, 0)="-", "-", TEXT(TIME(
 IFNA(REGEXEXTRACT(VLOOKUP(B86:B146, Sheet1!D:I, 6, 0), "(\d+)h")), 
 IFNA(REGEXEXTRACT(VLOOKUP(B86:B146, Sheet1!D:I, 6, 0), "(\d+)m")), 
 IFNA(REGEXEXTRACT(VLOOKUP(B86:B146, Sheet1!D:I, 6, 0), "(\d+)s"))), "[hh]:mm:ss"))))}

Sheet: https://docs.google.com/spreadsheets/d/1c3HdMq4PA50pYr88JqPoG51jvru8ipp8ebe4z5DczTQ/edit?usp=sharing

1
INDIRECT does not normally work under ARRAYFORMULA, but it can sometimes be manipulated to achieve what you want. Please share your sheet to make it editable by all, to let us help you.kirkg13

1 Answers

1
votes

See if this helps

={"HOURS"; 
ARRAYFORMULA(IFNA(IF(VLOOKUP(INDIRECT(J84),INDIRECT("Sheet1!"&J85), 6, 0)="-", "-", TEXT(TIME(
IFNA(REGEXEXTRACT(VLOOKUP(INDIRECT(J84), INDIRECT("Sheet1!"&J85), 6, 0), (\d+)h")), 
IFNA(REGEXEXTRACT(VLOOKUP(INDIRECT(J84), INDIRECT("Sheet1!"&J85), 6, 0), "(\d+)m")), 
IFNA(REGEXEXTRACT(VLOOKUP(INDIRECT(J84), INDIRECT("Sheet1!"&J85), 6, 0), "(\d+)s"))), "[hh]:mm:ss"))))}

Note: if you'd have the value 'Sheet1!D:I' in cell J85 you can change the second indirect to INDIRECT(J85)...