+ Reply to Thread
Results 1 to 10 of 10

Index & Match Less Than or Equal to Value

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459

    Index & Match Less Than or Equal to Value

    Good morning

    I need to enhance this code to look for anything less than or equals to a date. This date is in Cell C1

    =INDEX(Targets!$B$2:$AQ$337,MATCH($C$1+0,Targets!$A$2:$A$337,0),MATCH(A6,Targets!$B$1:$AQ$1,0))
    Can the current code be adapted?

    Thanks in advance

    DJ

  2. #2
    Valued Forum Contributor TheCman81's Avatar
    Join Date
    11-06-2012
    Location
    Edinburgh, UK
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    346

    Re: Index & Match Less Than or Equal to Value

    Are your dates in Column A?

    You can use something liek this

    =INDEX(Targets!$B$2:$AQ$337,IF(Targets!$A$2:$A$337<=$C$1,MATCH($C$1+0,Targets!$A$2:$A$337,0),""),MATCH(A6,Targets!$B$1:$AQ$1,0))

    if this doesn't work can you upload some sample data with expected results
    Excel Guru in the making

    <----------If the question has been answered to your satisfication please click the Add Repuation star to the left

  3. #3
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459

    Re: Index & Match Less Than or Equal to Value

    Hi, Yes my dates are in column A but that formula didn't work sorry. I will upload some sample data

  4. #4
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459

    Re: Index & Match Less Than or Equal to Value

    Example.xlsx Example File Attached

    Thanks

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

    Re: Index & Match Less Than or Equal to Value

    Instead of
    =INDEX(Targets!$B$2:$AQ$337,MATCH($C$1+0,Targets!$A$2:$A$337,0),MATCH(A5,Targets!$B$1:$AQ$1,0))
    try this
    =INDEX(Targets!$B$2:$AQ$337,MATCH($C$1,Targets!$A$2:$A$337),MATCH(A5,Targets!$B$1:$AQ$1,0))
    Samba

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

  6. #6
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459

    Re: Index & Match Less Than or Equal to Value

    That gives me the same result as the previous code. The answer in the example data for Book 2 should be £3,581,863.54 which is the sum of targets less than 01.09.14.

    Regards

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Index & Match Less Than or Equal to Value

    Perhaps in C5 and copy down.

    Formula: copy to clipboard
    =SUMPRODUCT((Targets!$A$2:$A$45<=$C$1)*(Targets!$B$1:$F$1=A5)*(Targets!$B$2:$F$45))
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  8. #8
    Forum Contributor
    Join Date
    08-24-2006
    Location
    Sevenoaks, Kent
    MS-Off Ver
    Office 365 ProPlus
    Posts
    459

    Re: Index & Match Less Than or Equal to Value

    Thanks that seemed to work but I'm now kicking myself for not trying that first. I though Sumproduct you could only use vertically and not a mixture of both vertically and horizontally. Hey, you live and learn.

    Thanks everyone for the contributions

    DJ

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Index & Match Less Than or Equal to Value

    Quote Originally Posted by djfatboyfats View Post
    Thanks that seemed to work but I'm now kicking myself for not trying that first. I though Sumproduct you could only use vertically and not a mixture of both vertically and horizontally. Hey, you live and learn.

    Thanks everyone for the contributions

    DJ
    Yes. SUMPRODUCT can works vertically and horizontally. Everyone of us learn something new every day. So:



    You are welcome and thanks for the feedback.

    As that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED,as per Forum Rule #9. Thank you.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

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

    Re: Index & Match Less Than or Equal to Value

    =SUM(OFFSET(Targets!$A$1,1,MATCH(A5,Targets!$B$1:$AQ$1,0),MATCH($C$1,Targets!$A$2:$A$337),1))
    Try this formula

+ 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 - Want value equal or greater to ACTUAL
    By heatwave in forum Excel General
    Replies: 1
    Last Post: 08-06-2014, 08:18 AM
  2. Replies: 6
    Last Post: 04-30-2014, 02:42 AM
  3. [SOLVED] Index Match equal to or less than date with multiple criteria
    By harrismlzn in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-19-2014, 05:38 PM
  4. Replies: 17
    Last Post: 12-05-2012, 09:01 PM
  5. [SOLVED] Using Index/Match (Equal or less than) with Multiple Criteria
    By Padal in forum Excel General
    Replies: 4
    Last Post: 07-06-2012, 05:10 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