+ Reply to Thread
Results 1 to 12 of 12

Porblem using LOOKUP and empty cells

Hybrid View

  1. #1
    Registered User
    Join Date
    06-15-2013
    Location
    Spain
    MS-Off Ver
    Excel 2003
    Posts
    17

    Porblem using LOOKUP and empty cells

    Hi all
    I need any suggestions on how to solve this problem,
    I'm looking for a formula that calculates how many times this condition (D = E) does not happen, since the last time it happened.
    The problem came when I include empty rows, the formula does not work correctly.
    I attach a small sample for better understanding (sorry my basic english)

    Thanks!

    ERROR LOOKUP.xlsx

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Porblem using LOOKUP and empty cells

    try below
    =SUMPRODUCT((D2:D1000<>"")*(E2:E1000=D2:D1000)*(D2:D1000>0))

    it will check for empty row at the same time if D2:D2000 is >0 then only it will perform comparison of D2=E2 and so on

    In case D2=E2 and both are zero and want to count it as 1 also then use below

    =SUMPRODUCT((D2:D1000<>"")*(E2:E1000=D2:D1000))
    Last edited by hemesh; 01-30-2016 at 04:36 PM.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    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
    30,684

    Re: Porblem using LOOKUP and empty cells

    Try

    =SUMPRODUCT(--(D2:D1000>0)*(D2:D1000=E2:E1000))

    I assume D/E > 0

  4. #4
    Registered User
    Join Date
    06-15-2013
    Location
    Spain
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Porblem using LOOKUP and empty cells

    I dont know why none of the mentioned formulas works ok, I finally used someone suggestion dynamic names to solve the problem, thanks all for your answers!

  5. #5
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Porblem using LOOKUP and empty cells

    As per of your attachment all mentioned formulas work OK ! where it is not working can you please let us know

  6. #6
    Registered User
    Join Date
    06-15-2013
    Location
    Spain
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Porblem using LOOKUP and empty cells

    Ok, i attach the table with two sheets, one ko, and one ok

    ERROR LOOKUP-solved.xlsx

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Porblem using LOOKUP and empty cells

    You may try this Array Formula which requires confirmation with Ctrl+Shift+Enter instead of Enter alone.

    =LOOKUP(2,1/D2:D1000,ROW(D2:D1000))-LOOKUP(2,1/IF(D2:D1000<>"",IF(E2:E1000<>"",(D2:D1000=E2:E1000))),ROW(D2:D1000))
    Remember that an Array Formula is confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Attached Files Attached Files
    Last edited by sktneer; 01-30-2016 at 05:09 PM.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  8. #8
    Registered User
    Join Date
    06-15-2013
    Location
    Spain
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Porblem using LOOKUP and empty cells

    Quote Originally Posted by sktneer View Post
    You may try this Array Formula which requires confirmation with Ctrl+Shift+Enter instead of Enter alone.

    =LOOKUP(2,1/D2:D1000,ROW(D2:D1000))-LOOKUP(2,1/IF(D2:D1000<>"",IF(E2:E1000<>"",(D2:D1000=E2:E1000))),ROW(D2:D1000))
    Remember that an Array Formula is confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Fantastic!, this one works like a charm!

    Thanks sktneer and all for your help

    regards

  9. #9
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Porblem using LOOKUP and empty cells

    You're welcome Lehoi! Glad it worked for you.
    Also thanks for the feedback as well.

  10. #10
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Porblem using LOOKUP and empty cells

    then try below
    =MAX((D2:D1000<>"")*(ROW(A2:A1000)))-MAX((D2:D1000=E2:E1000)*ROW(E2:E1000)*(E2:E1000<>""))

    copy paste above then hold control and shift together and then hit enter to make it array formula

  11. #11
    Registered User
    Join Date
    06-15-2013
    Location
    Spain
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Porblem using LOOKUP and empty cells

    Quote Originally Posted by hemesh View Post
    then try below
    =MAX((D2:D1000<>"")*(ROW(A2:A1000)))-MAX((D2:D1000=E2:E1000)*ROW(E2:E1000)*(E2:E1000<>""))

    copy paste above then hold control and shift together and then hit enter to make it array formula
    This one works perfect too, thanks hemesh, all of you are great experts.
    Hope one day I could have the 1% of your excel knowledge

  12. #12
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Porblem using LOOKUP and empty cells

    @ Lehoi ! You are welcome, Thanks for your feedback.

    If you are serious about learning excel Try coming here a lot.

    More we learn about excel, more it shows us, how less we know about it.

+ 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] porblem with time calculation over days
    By Dj Duck in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-24-2016, 08:35 PM
  2. [SOLVED] LookUp skipping empty cells and returning first entry
    By Colin Smit in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-28-2015, 05:51 AM
  3. Calculating Porblem during Autofilter mode.
    By weeeee0713 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-12-2014, 02:32 AM
  4. [SOLVED] How to empty the lookup output cells when the primary cells are emptied?
    By ohlalayeah in forum Excel General
    Replies: 3
    Last Post: 07-04-2012, 05:06 AM
  5. Replies: 0
    Last Post: 09-07-2011, 07:51 PM
  6. Latitude/Longitude Porblem
    By edwardtong694 in forum Excel General
    Replies: 3
    Last Post: 05-20-2009, 12:23 PM
  7. Lookup without empty cells.
    By comotoman in forum Excel General
    Replies: 3
    Last Post: 10-04-2005, 11:16 AM

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