+ Reply to Thread
Results 1 to 11 of 11

IF statement that also uses index match to verify if date falls with date range

  1. #1
    Banned User!
    Join Date
    09-26-2015
    Location
    Manchester
    MS-Off Ver
    2013
    Posts
    218

    IF statement that also uses index match to verify if date falls with date range

    Hi All,

    With reference to the attached.

    I have a table for projected revenue sales covering the period Jan-17 - Dec-25 (see table L17 : DO113). The revenues in this table are expressed in dollars. These revenues are a function of the information input into table B17 : J113.

    The table B17 : J113 lists all the different revenue streams and contains fields (for user input) which assist in the quantification of those revenues. Column E in this table is effectively the price list (for the next 8 years....) that is applicable to all customers and products. It is key to know that the same product can be sold to two different customers for two different prices e.g row 22 shows Product A being sold to Customer A for $30. Row 31 shows Product A being sold to Customer D for $12.50.

    For the purpose of this exercise, the prices in column E are fixed for each customer and not subject to increase or decrease at any time with the exception of prices for Customer A. You will see Customer A is typically being charged a higher rate than all other customers and as such, this customer demands regular price decreases over the course of a number of years.

    So whilst the 'Expected Monthly Revenue' (column G of table B17 : J113 - which are also shown in every column of table L17 : DO113) should be fixed for all customers except customer A, customer A's 'Expected Monthly Revenues' should read "See Rate Reduction Table". The revenues for customer A in the table L17 : DO113 should be a function of the expected sales units (column F) multiplied by the applicable rate for that month, and the applicable rate for that month is shown in table B2 : L10.

    The problem is, I don't know how to create a formula in cells L20: DO113 that gives a revenue value based on the following criteria:
    - If customer in column D = "Customer A" then multiply expected sales units (column F) by the rate in place in the relevant month as per table B2 : L10. The relevant month being shown in cells L17 : BO17
    - If not, the existing formula is these cells applies

    No doubt any solution will use an IF statement (IF customer = "Customer A" ...) which incorporates an index match function allowing for the comparison (greater than, equal to or less than) of current month as per table L17 : BO113, to the month in the table B2 : L10, thereby generating a singular rate to be applied to sales unit activity.
    Attached Files Attached Files

  2. #2
    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,981

    Re: IF statement that also uses index match to verify if date falls with date range

    So what should the outcome in L20 be, then?
    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.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: IF statement that also uses index match to verify if date falls with date range

    Shouldn't C3:L3 contain month dates? i.e. January - December?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Banned User!
    Join Date
    09-26-2015
    Location
    Manchester
    MS-Off Ver
    2013
    Posts
    218

    Re: IF statement that also uses index match to verify if date falls with date range

    Sorry, this is something I should have defined to make things easier for everyone.

    Cell L20 is currently showing the correct value because column L represents the month of January 2017 and row 20 shows sales of Product C to Customer A. As per the rate reduction table (B2 : L10), the rate for sales of Product C to Customer A is $40 for the months Oct-16 - Sep-17. From Oct-17, this rate for this product decreases to $23.50.

    Hence in columns L - T (Oct-16 - Sep-16) the sales revenue for row 20 should show as $60,040 (units of 1,501 x $40). From columns U - AF the sales revenue for row 20 should show as $38,275.50 (1,501 units x $25.50) and so on.

  5. #5
    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,215

    Re: IF statement that also uses index match to verify if date falls with date range

    Try in L20

    Please Login or Register  to view this content.

  6. #6
    Banned User!
    Join Date
    09-26-2015
    Location
    Manchester
    MS-Off Ver
    2013
    Posts
    218

    Re: IF statement that also uses index match to verify if date falls with date range

    Hi John,

    I've tried this formula but it doesn't mean to work. I'm still getting the same values across columns L - BO i.e. revenues aren't reducing in line with rate change.

    I don't know if this impacts on your formula, but in answer to Richard Buttreys question, cells C3:L3 show the effective date of the rate change. By way of reference to the spreadsheet, cells C3:C10 show the current rates being charged (being charged from Oct-16). These rates do not change until Oct-17 (D3:D10) which infers (and this is actually the case) that the rates up until Oct-17 i.e. up to 30-Sep-2017 will still be the rates shown in cells C3:C10. Hopefully that makes sense.

  7. #7
    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,215

    Re: IF statement that also uses index match to verify if date falls with date range

    Try

    =IF($D20="Customer A",$F20*INDEX($C$4:$L$9,MATCH($C20,$B$4:$B$10,0),MATCH(L$17,$C$3:$L$3,1)),IF($J20="No",0,IF(AND(O$17>=$H20,O$17<$I20),$G20,0)))


    Typo by me!!!

  8. #8
    Banned User!
    Join Date
    09-26-2015
    Location
    Manchester
    MS-Off Ver
    2013
    Posts
    218

    Re: IF statement that also uses index match to verify if date falls with date range

    Thanks John, perfect solution, as always.

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: IF statement that also uses index match to verify if date falls with date range

    Quote Originally Posted by STUARTXL View Post
    Hi John,

    I've tried this formula but it doesn't mean to work. I'm still getting the same values across columns L - BO i.e. revenues aren't reducing in line with rate change.

    I don't know if this impacts on your formula, but in answer to Richard Buttreys question, cells C3:L3 show the effective date of the rate change. By way of reference to the spreadsheet, cells C3:C10 show the current rates being charged (being charged from Oct-16). These rates do not change until Oct-17 (D3:D10) which infers (and this is actually the case) that the rates up until Oct-17 i.e. up to 30-Sep-2017 will still be the rates shown in cells C3:C10. Hopefully that makes sense.
    The point in my question was shouldn't C3:L3 show MONTHS. At the moment your formula is returning successive dates in October only.
    i.e. shouldn't C3 be 1/1/2017 (i.e. 1st October) and then D3
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    copied across to L3

    Similarly in L17 and across

    Then your L20 formula (copied across and down) will be

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    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,981

    Re: IF statement that also uses index match to verify if date falls with date range

    Richard - I believe those values are a meant to be a month and a year, not a month and a date, so October 2016, 2017, 2018, etc.

  11. #11
    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,215

    Re: IF statement that also uses index match to verify if date falls with date range

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

+ 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: 7
    Last Post: 07-14-2017, 12:04 PM
  2. [SOLVED] Index Match-return an amount if a date falls between two dates
    By HRpersonnel in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-09-2016, 12:06 AM
  3. [SOLVED] index match a value if date falls between two dates
    By Blake 7 in forum Excel General
    Replies: 4
    Last Post: 08-08-2014, 11:51 AM
  4. [SOLVED] INDEX date that MATCH on date range, MATCH code(string)
    By Dahlia in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-23-2014, 03:33 AM
  5. [SOLVED] If statement to check if date falls between date range
    By mcranda in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-21-2013, 07:31 PM
  6. Replies: 15
    Last Post: 04-08-2013, 12:40 PM
  7. Mark cell if location matches and date falls between date range
    By DoodlesMama in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-24-2012, 07:54 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