+ Reply to Thread
Results 1 to 24 of 24

LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

  1. #1
    Registered User
    Join Date
    05-18-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    30

    LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    I have a row like below

    4
    Blank
    Blank
    Blank
    Blank
    6
    Blank
    Blank
    10
    Blank
    Blank
    Blank
    .
    .
    .
    I want a formula to LOOKup a value and count blanks below (till next value).

    Please help

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    pls attach a sample excel file
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Registered User
    Join Date
    05-18-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    30

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    attached is the sample
    Attached Files Attached Files

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    in your attached file what is your lookup value and what is the expected result for that

  5. #5
    Registered User
    Join Date
    05-18-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    30

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    look up values will be picked from a cell, in this case lets say lookup value is 7 and expected result is "5" (as there are 5 blank cells between 7 and next value.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,207

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    Try

    =SUMPRODUCT(--($D$1:$D$19=INDEX($D$1:$D$19,MATCH($F$1,$A$1:$A$19,0))))

    F1= lookup value

  7. #7
    Registered User
    Join Date
    05-18-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    30

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    working, thanks
    Last edited by learnall18; 05-18-2016 at 06:17 AM.

  8. #8
    Registered User
    Join Date
    05-18-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    30

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    thanks, it works....but what if there is no column D?

  9. #9
    Registered User
    Join Date
    05-18-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    30

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    IT WORKS, BUT VALUES IN coloumn D can be different, so column d should not matter. please modify the formula.

  10. #10
    Registered User
    Join Date
    09-04-2015
    Location
    Bangalore
    MS-Off Ver
    2010
    Posts
    15

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    if u just want the count of blank cells in the given range u can use =COUNTBLANK(Range) ,,

    if it is something else give one example..

  11. #11
    Registered User
    Join Date
    05-18-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    30

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    But i dont want in full range, i just want the count of blank between lookup value and next "non-blank" value below in a ROW

  12. #12
    Registered User
    Join Date
    05-18-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    30

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    please have a look
    Attached Files Attached Files

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,207

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    Are numbers in "A" ALWAYS ascending?

  14. #14
    Registered User
    Join Date
    05-18-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    30

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    Yes. Always ascending. but rarely there might be a big number in between

  15. #15
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,207

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    Try this BUT assumes ascending numbers in A

    =MATCH(SMALL($A$1:$A$97,RANK($E$1,$A$1:$A$97,1)+1),A$1:A$97,0)-MATCH($E$1,$A$1:$A$97,0)-1

  16. #16
    Registered User
    Join Date
    05-18-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    30

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    Works!! but returns the error if there are variation in B and C Columns are sometimes there may be blank cells in B and C Coloums

  17. #17
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,207

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    As formula doesn't use B or C I don't see why it doesn't work. I cleared B & C and it still gave the correct answer.

    I don't why are doing this anyway: I can't see any logic for it!

  18. #18
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    =MATCH(1,INDEX((INDEX(C:C,MATCH(F1,A:A,0)):INDEX(C:C,MATCH(10^10,C:C)+1)="")+0,0),0)-1
    f1 is the lookup value

  19. #19
    Registered User
    Join Date
    05-18-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    30

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    thanks a lot john, i misinterpreted it, your formula works. my problem is resolved. thank you again :-). just in case would be great if you can resolve ascending limitation.

  20. #20
    Registered User
    Join Date
    05-18-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    30

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    thanks nflsales, would be great if you can modify the formula which is no relation to the values in B,C,D column (as there might be variations), cant we just use A Column?

  21. #21
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    it can be done but it is difficult to get the answer for last number which in 9 in your example

  22. #22
    Registered User
    Join Date
    05-18-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    30

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    we can ignore last number sir.

  23. #23
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    then try below formula
    Please Login or Register  to view this content.

  24. #24
    Registered User
    Join Date
    05-18-2016
    Location
    india
    MS-Off Ver
    2007
    Posts
    30

    Re: LOOKUP A VALUE IN A ROW and COUNT Number of BLANKS Below it till NEXT Value

    Works like a charm! Thank you.

+ 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. Replies: 2
    Last Post: 12-04-2014, 06:25 AM
  2. Replies: 2
    Last Post: 12-04-2014, 06:22 AM
  3. [SOLVED] Count number of blanks across several columns
    By shepherdc2814 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 11-19-2013, 05:26 PM
  4. Search for specific data and count number of rows till empty Cell
    By kjanani30 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-04-2013, 06:05 AM
  5. [SOLVED] Count the number of days till the next birthday
    By JO505 in forum Excel General
    Replies: 5
    Last Post: 12-21-2012, 06:12 PM
  6. count number of Simultaneous blanks
    By rinks_84 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-12-2012, 05:35 PM
  7. Count the total number of rows in a column, with blanks included
    By jblumGRT in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-22-2009, 06:55 PM

Tags for this Thread

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