# Excel: How to get last result from above

I have a problem that is described in the picture below. Until today, I have done manual changes to the formula and that will take time if I have massive data.

Anyone can help? I want to fix B7 and the next cell if I found another gap.

This is what i use: • Can you please edit your question to 1) add the formula you are currently using (as text) 2) let us know exactly what the expected output is Nov 22 '18 at 5:09
• Can you not remove that row?
– Dave
Nov 22 '18 at 6:43

You can utilize the `LOOKUP` formula to find the next non-empty value from above. For example, in row 7, column B (like in your example), enter

``````  =LOOKUP(2,1/(B\$1:B6<>""),B\$1:B6)
``````

This will find the next non-empty value in the area above B7. I have placed the \$ characters intentionally for copying the formula down the column.

(detailed explanation of the formular here)

If you have several thousands of rows, this may become a little bit slow, since the above formula leads to quadratic run time behaviour. If thats the case, but there is a known limit for the size of your gaps (for example, 2 rows), you can restrict the lookup to this specific number of rows, like

``````  =LOOKUP(2,1/(B4:B6<>""),B4:B6)
``````

This checks only the three rows above B7 for valid values.

• sorry for slow respond, i will test it now Nov 29 '18 at 7:54
{"ft_lang_label":"__label__en","ft_lang_prob":0.916394,"math_prob":0.86180276,"size":1374,"snap":"2021-43-2021-49","text_gpt3_token_len":334,"char_repetition_ratio":0.118978105,"word_repetition_ratio":0.35772356,"special_character_ratio":0.24163027,"punctuation_ratio":0.11371238,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98797023,"pos_list":[0,1,2],"im_url_duplicate_count":[null,1,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-11-28T09:31:46Z\",\"WARC-Record-ID\":\"<urn:uuid:26c8a040-679f-4d69-8c73-9b5cc4db9093>\",\"Content-Length\":\"136832\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:bec51d5d-bb4a-4b99-809a-057c5cfdd9ff>\",\"WARC-Concurrent-To\":\"<urn:uuid:b373182f-bef4-47fa-a01f-083d3ef8f780>\",\"WARC-IP-Address\":\"151.101.129.69\",\"WARC-Target-URI\":\"https://superuser.com/questions/1377467/excel-how-to-get-last-result-from-above/1377490\",\"WARC-Payload-Digest\":\"sha1:E75PF7AP5DPT77CPOURMYSHHY6NBMHQC\",\"WARC-Block-Digest\":\"sha1:EMFWRR3O3NSAVYQVHMOYGSOOFVPWGV6Q\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-49/CC-MAIN-2021-49_segments_1637964358480.10_warc_CC-MAIN-20211128073830-20211128103830-00607.warc.gz\"}"}