+ Reply to Thread
Results 1 to 3 of 3

Due date formula not selecting correct option

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365 Version 2501 64-bit
    Posts
    1,465

    Due date formula not selecting correct option

    Attachment has dummy list of clients in Col P, each of whom have a "credit period" in Col Q

    Selecting the client from DropList in C6 triggers "index Match" to identify which Credit period to apply, based on the terms listed in Col Q

    I have listed the permutations in I15 - I23 to make analysis simpler:

    I15 - s/be blank unless Terms are "END OF WEEK" and invoice dated Mon - Thu. Should show payment due on Friday
    =IF(AND(INDEX(Q2:Q27,MATCH(C6,P2:P27,0)="EOWEEK"),6-WEEKDAY(C4)>=1),C4+6-WEEKDAY(C4),"")

    I17 - s/be blank unless Terms are "END OF WEEK" and Invoice dated Friday - Should show payment due following Friday
    =IF(AND(INDEX(Q2:Q27,MATCH(C6,P2:P27,0)="EOWEEK"),6-WEEKDAY(C4)<1),C4+7+6-WEEKDAY(C4),"")

    I19 - s/be Blank unless Terms are "END OF MONTH" - payment due last day of Invoice date month
    =IF(INDEX(Q1:Q27,MATCH(C6,P1:P27,0))="EOMONTH",EOMONTH(C4,0),"")

    I21 - s/be blank unless Terms are "MONTH" - payment due calendar month after invoice date
    =IF(INDEX(Q1:Q27,MATCH(C6,P1:P27,0))="MONTH",DATE(YEAR(C4),MONTH(C4)+1,DAY(C4)),"")

    I23 - s/be blank unless Terms are number of days - payment due number of days after invoice date
    =IFERROR(INDEX(Q1:Q27,MATCH(C6,P1:P27,0))+C4,"")

    Formula in C8 should combine the five options, and show the correct date against whichever credit terms matching the client in in C6, and the day the invoice was raised

    Problem 1 is that the "End of Week" formulae are not working properly, and therefore the "combined" formula throws errors.

    Any solution or pointers accepted gratefully as ever,

    Ochimus
    Attached Files Attached Files

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Due date formula not selecting correct option

    your EOWEEK formulas have a right parenthesis wronly placed.
    here is the first formula corrected and working:
    =IF(AND(INDEX(Q2:Q27,MATCH(C6,P2:P27,0))="EOWEEK",6-WEEKDAY(C4)>=1),C4+6-WEEKDAY(C4),"")
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365 Version 2501 64-bit
    Posts
    1,465

    Re: Due date formula not selecting correct option

    Thanks for the prompt response and spotting the error.

    One small adjustment sorted everything - and I've been going cross-eyed ploughing through the pack for hours.

    intriguing that the formula doesn't like Saturdays?

    Fortunately the end user never asked for that facility, but must work out why at some point,

    Ochimus

+ 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. Selecting the Correct Formula
    By vincywoman1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-11-2014, 01:40 AM
  2. [SOLVED] script to selecting correct sheet calculated via cell formula
    By Kramxel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-17-2013, 09:42 AM
  3. ADOdb not selecting correct data within Date Range
    By mvgoggans in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-15-2012, 03:50 PM
  4. displaying date in correct format within formula
    By tryer in forum Excel General
    Replies: 1
    Last Post: 08-06-2009, 01:27 PM
  5. selecting first correct argument in if statement
    By gss in forum Excel General
    Replies: 4
    Last Post: 06-09-2009, 02:27 AM
  6. Date Format Correct, But Formula Error
    By john_mc in forum Excel General
    Replies: 1
    Last Post: 04-09-2006, 11:30 PM
  7. Navigating between option buttons is not selecting the option
    By Ramana in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-03-2005, 10:05 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