+ Reply to Thread
Results 1 to 8 of 8

How to get value from first non-blank cell and also last cell (2 formulas)

  1. #1
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    How to get value from first non-blank cell and also last cell (2 formulas)

    for example :

    cells
    a1
    a2
    a3 20
    a4 30
    a5 40
    formula to give value from the first cell with data


    a separate formula to give value from the last cell with data
    cells
    a1 11
    a2 10
    a3 20
    a4 30
    a5


    Please help.

    Thank you.

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: How to get value from first non-blank cell and also last cell (2 formulas)

    Hi Try this






    =INDEX(A1:A5,MIN(IF(A1:A5<>"",ROW(A1:A5),"")))

    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).

    =LOOKUP(2,1/--(A1:A5<>""),A1:A5)
    Cheers!
    Deep Dave

  3. #3
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: How to get value from first non-blank cell and also last cell (2 formulas)

    Thanks.
    Is it possible to have a non-array formula?

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: How to get value from first non-blank cell and also last cell (2 formulas)

    Or try:

    =INDEX(A1:A5,MATCH(TRUE,INDEX(A1:A5<>"",0),0))

  5. #5
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: How to get value from first non-blank cell and also last cell (2 formulas)

    Try this for 1st Non-Blank value.

    =INDEX(A1:A5,MATCH(TRUE,INDEX((A1:A5<>0),0),0))

    For Last Non Blank Value

    =LOOKUP(2,1/--(A1:A5<>""),A1:A5)

  6. #6
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: How to get value from first non-blank cell and also last cell (2 formulas)

    Thank you Phuocam and NeedForExcel
    both your formulas good for me.

    Thanks. Have a nice day.


  7. #7
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: How to get value from first non-blank cell and also last cell (2 formulas)

    Glad I could help. Just 1 thing, My Solution has A1:A5<>0, and Phuocams soultion has A1:A5<>"". I think Phuocams is more precise than mine, so I would suggest you use that.

  8. #8
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: How to get value from first non-blank cell and also last cell (2 formulas)

    Oh...thanks for letting me know, may I know what's the difference?

    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Clearing formulas returning 0 to a blank cell
    By Chris1976 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-07-2020, 05:31 AM
  2. [SOLVED] Which of these formulas is best for checking if a cell is blank or is there a better way?
    By Belinea2010 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-02-2020, 01:04 PM
  3. [SOLVED] drag formulas until blank cell
    By jharvey87 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-24-2018, 11:39 AM
  4. [SOLVED] COUNTIFS formula keeps counting blank cell with formulas.
    By Big.Moe in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-03-2017, 08:22 PM
  5. Replies: 11
    Last Post: 09-15-2014, 02:36 AM
  6. Replies: 2
    Last Post: 06-02-2014, 02:30 PM
  7. Help with Formulas, how to keep a cell blank
    By stevedd01 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-20-2013, 02:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1