1

In Excel, I have a range B4:E100 in a worksheet, assume the content is like the follows. I'm looking for a formula (as simple as possible, with new Excel functions probably) that returns B4:E8, because there is nothing below row 8.

Does anyone know how to write such a formula that takes B4:E100 as input?

enter image description here

6
  • Try using TRIMRANGE() reference operators: =LET(a, B4.:.E100, IF(a=0,"",a)) Commented Feb 26 at 22:12
  • May I know what the expected output range is should be? is it B8:E8 or B4:E8? if the latter then. =LET(a, TAKE(B4.:.E100,-1), IF(a=0,"",a)) Commented Feb 26 at 22:14
  • Sorry, the expected output should be B4:E8, i just corrected it in the OP. Commented Feb 26 at 22:20
  • Do you have the TRIMRANGE() function? Commented Feb 26 at 22:23
  • Yes, I do. I tried =TRIMRANGE(B4:E00,2), it fills empty cells with 0, how could i avoid that? Commented Feb 26 at 22:24

1 Answer 1

2

Try using the TRIMRANGE() function or its reference operators:

enter image description here


• Formula used in cell G4

=LET(a, B4:.E100, IF(a=0,"",a))

Or,

=LET(a, TRIMRANGE(B4:E100,2), IF(a=0,"",a))

Can read here more on the said function: TRIMRANGE() Function

Sign up to request clarification or add additional context in comments.

1 Comment

Be aware that IF(a=0,"",a) is an extra calculation to use the result as the argument in a formula, thus it should be omitted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.