+ Reply to Thread
Results 1 to 11 of 11

Lookup code,check number of entries and check how many cells are greater than another row

  1. #1
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Lookup code,check number of entries and check how many cells are greater than another row

    Hi,
    I am really hoping someone will know how to do the following. I have tried a few things but really struggling.

    I have two worksheets and want to be able to lookup a cell reference from Sheet2 in Sheet 1 and then perform several calculations as follows:-

    E.G

    1. I want a formula in sheet1 column B1 that firstly looks up the code in Sheet1 A1 on Sheet 2 column A
    2. Then checks that there is a certain number of entries in column B:G for that code e.g. 6. If there is not then it returns a blank but if there is then it goes to the next part of the calculation
    2. I want to see how many cells are greater than the same column but a different row in Sheet2 e.g. Row 3, and give me a count of how many are, however, I need it to then skip a column e.g. B1 compared to B3, then D1 compared to D3 then F1 compared to F3

    In the above scenario the formula would give the result 2 as two of the cells referenced are greater than row 3.

    I hope that makes sense and I appreciate any help. I have attached a file as an example.

    Thanks

    Paul
    Attached Files Attached Files
    Last edited by pareid; 07-22-2018 at 08:09 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: Index match

    I don't know whay it has taken 3 days to get a reply to this.... However, your explanation of Part 2 was a bit confusing... That said, is this what you want?

    =SUMPRODUCT((Sheet2!$B$2:$G$4>3)*(Sheet2!$A$2:$A$4=Sheet1!$A$2))

    If not, please provise SEVERAL examples of the desired results.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Index match

    Probably the inadequate thread title.

    Welcome to the forum! Please take a moment to re-read forum rule #1 and then amend your thread title to something that better explains your problem. Changing your thread title is not optional, which means you must change it. Thanks!

    • Use concise, accurate thread titles.
    • Your post title should describe your problem, not your anticipated solution.
    • Use terms appropriate to a Google search - poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice tell us nothing.
    • Responding to a request to change your thread title by doing so is mandatory.

    To change a title go to your first post, click EDIT then Go Advanced and change your title.

    No further help to be offered, please, until the OP complies with this request.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: Index match

    Hi Glenn, and thank you for replying. I didn't realise I had broken the rules in terms of the title of my post so I have amended it.

    I have uploaded another worksheet with more examples and apologies for not being particularly clear.

    In the upload I have highlighted on sheet 2 the important columns but to explain better I need sheet 1 to lookup the code in column A from column A in sheet2 and firstly count if there is data in cells B to I i.e. 8 entries. In the example this would leave a blank for the codes KLOT and DEF as they don't have enough data.

    For the ones with 8 entries I need the formula to count how many cells are greater than row 7 but I need it to only check every other column i.e B,D,F,H etc...

    I have put the expected answers on sheet 1.

    I hope that helps and thanks again.

    Regards

    Paul
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: Index match

    Sorry about that, I have amended the title.

    Regards

    Paul

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: Lookup code,check number of entries and check how many cells are greater than another

    One way:

    =IF(COUNT(Sheet2!B2:I2,"<>""")=8,SUMPRODUCT(--((Sheet2!B2:I2)*ISEVEN(COLUMN(Sheet2!$B$1:$I$1))>Sheet2!$B$7:$I$7)),"Insufficient")
    Attached Files Attached Files

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: Lookup code,check number of entries and check how many cells are greater than another

    I should have said... this relies on the rows being in the same order on both sheets (like your example). It thy're not, it will require modification.

  8. #8
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: Lookup code,check number of entries and check how many cells are greater than another

    Thanks Glenn that works a treat. If the codes were not in order which may be a possibility but hopefully not do you know what I would need to add it?

    Regards

    Paul

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: Lookup code,check number of entries and check how many cells are greater than another

    maybe this... array entered.

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    08-04-2016
    Location
    Sutton Coldfield
    MS-Off Ver
    Microsoft 365
    Posts
    46

    Re: Lookup code,check number of entries and check how many cells are greater than another

    Thanks Glenn,

    All sorted.I appreciate your help.

    Regards

    Paul

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,002

    Re: Lookup code,check number of entries and check how many cells are greater than another

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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] INDEX+MATCH instead of VLOOKUP+MATCH, why is INDEX a better choice and how to re-write?
    By Renejorgensen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2016, 10:54 AM
  2. [SOLVED] Index / Match - match 3 input values and return the results from the index
    By t83357 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-08-2016, 07:34 PM
  3. [SOLVED] Match-Index in stead of Index-Match lookup Array among Arrays
    By Numnum in forum Excel General
    Replies: 2
    Last Post: 10-15-2015, 02:08 PM
  4. INDEX MATCH MATCH/OFFSET MATCH MATCH with named ranges
    By Andrew-Mark in forum Excel General
    Replies: 3
    Last Post: 02-27-2015, 10:56 PM
  5. Replies: 6
    Last Post: 04-30-2014, 02:42 AM
  6. Replies: 6
    Last Post: 11-08-2013, 10:29 PM
  7. Replies: 3
    Last Post: 05-02-2013, 01:31 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