+ Reply to Thread
Results 1 to 9 of 9

IF formula has reached it's limit - need another solution!

  1. #1
    Forum Contributor heytherejem's Avatar
    Join Date
    07-06-2017
    Location
    Hampshire, England
    MS-Off Ver
    2016
    Posts
    152

    IF formula has reached it's limit - need another solution!

    Hi there,

    So I have a spreadsheet which holds financial transactions, and the date the transaction took place.
    My company have a financial calendar which means that transactions after the monthly 'cut off' date, will fall into the following month. The cut off date is different each month. So we have a transaction date, and a posting date. The posting date just being the month and the year.

    We always know when the cut off date is, so these dates are in a worksheet, and in order to know which month the transactions fall into (the posting date), we have nested IF functions to say if the transaction date is less than _ then show _ and it displays a month and year for the relevant posting date.

    However.

    We have 24 months we need to account for, and the IF function has worked with 19 nested IFs but for month 20 it's said there are too many arguments.

    Any ideas for an alternative???

    Jemma

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: IF formula has reached it's limit - need another solution!

    maybe a Vlookup with a table reference? (provided they aren't individual dates, like 1/2017 and 2/2017 vs 1/1/2017 and 1/2/2017 for example)
    it is difficult to make a good assessment without seeing at least what the formula you are using looks like.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: IF formula has reached it's limit - need another solution!

    Good afternoon heytherejem

    Set up a table on another sheet, which lists all the transaction dates (ie 365 days per year - not just the used ones) in a left hand column, and the relevant posting date to the right of this column.
    Then use a VLOOKUP formula to compare the transaction date and determine the relevant posting date.

    HTH

    DominicB

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: IF formula has reached it's limit - need another solution!

    You can often replace multiple IF statements with one simple VLOOKUP function of the form:

    VLOOKUP(sought_item, lookup_table, column_num, search_type)

    where the sought_item parameter is the cell that contains your transaction date, the lookup_table is a list of dates and corresponding month/year, column_num will be 2 in this case, and search_type will be TRUE (or 1, or omitted). In your lookup_table, you only need to show the first date that the month/year applies to, like this:

    1/01/2018 ...... 01/18
    29/01/2018 .... 02/18
    26/02/2018 .... 03/18

    and so on. You can give the table a name, or you can use the range reference (but ensure that you use absolute addressing so that the references do not change when you copy the formula elsewhere).

    Hope this helps.

    Pete

  5. #5
    Forum Contributor heytherejem's Avatar
    Join Date
    07-06-2017
    Location
    Hampshire, England
    MS-Off Ver
    2016
    Posts
    152

    Re: IF formula has reached it's limit - need another solution!

    Yeah but with a Vlookup we would have to list out every single date in the last two years and assign it the correct posting date. At the moment the IF formula is just seeing if the transaction date is less than the cut off date and if so, it displays one month, and if it's not less than it displays the next month.

    The nested IF just points to the date, asks if it's less than - say 20th Jan 2016 - to return "01 2016". If it's less than 17th Feb 2016 to return "02 2016" and so forth for 19 months, but we can't do the last 5 months (got to be 2 years).

    If we have to do a vlookup sobeit but I figured there might be an alternative...

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: IF formula has reached it's limit - need another solution!

    Check out my reply - you will only need a table with 24 entries, where each entry shows only the FIRST date for each range of dates, rather than the LAST one which you seem to be using.

    Hope this helps.

    Pete

  7. #7
    Forum Contributor heytherejem's Avatar
    Join Date
    07-06-2017
    Location
    Hampshire, England
    MS-Off Ver
    2016
    Posts
    152

    Re: IF formula has reached it's limit - need another solution!

    Hi Pete,

    That looks like it would work perfectly, if only I understood how to create a vlookup to a table like that!
    I have to log off now, but i'll have a look at this tomorrow using the data - and if I get stuck, i'll attach some sample data to this thread and if you're about tomorrow I would really appreciate your help :-)

    I see you're Warrington-based - did you ever watch the sitcom 'Trollied' about the supermarket in Warrington? Very funny!

  8. #8
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: IF formula has reached it's limit - need another solution!

    A sample file would help us help you greatly. Especially showing what you are currently doing via IF and what your desired result would look like.

    I however agree with the spirit of what others have said. If currently your IF statement statically assigns the desired result based on the evaluation, you are likely looking to create a reference table instead. In other words a table that has your desired dates and a formula that evaluates the date in your record vs the reference table to return the desired date. As mentioned you can do a VLOOKUP with a TRUE 4th argument (or omit it) to do a closest match lookup using basically the concept of tiers.

    You can do variations of this concept, but how depends on your actual data/layout and desired results, which we have no context for.
    Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.

    "I am here to help, not do it for people" -Me

  9. #9
    Valued Forum Contributor
    Join Date
    03-16-2017
    Location
    UK
    MS-Off Ver
    2016
    Posts
    371

    Re: IF formula has reached it's limit - need another solution!

    Kudos to whoever built your 19-level nested IF formula. That takes time, dedication, and focus.

    See attached workbook for my solution using INDEX and MATCH. I only went back three years, I hope that's okay
    Attached Files Attached Files
    Design everything to be as simple as possible, but no simpler.

+ 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] Help: SUM/ max limit / return 0 if reached
    By happydays886 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-07-2016, 02:07 PM
  2. Help: SUM/ max limit / return 0 if reached
    By happydays886 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-07-2016, 12:22 PM
  3. [SOLVED] Reached the limit of MATCH?
    By Exequiel3k in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-01-2016, 01:18 PM
  4. Nested IF Index Match formula reached limit. Suggestions?
    By patrickt in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-06-2015, 03:04 AM
  5. [SOLVED] Have I reached nested if limit on only the 9th nest?
    By pongmeister in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-31-2015, 04:02 PM
  6. Adding until limit reached
    By deli9680 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-09-2012, 11:20 AM
  7. sheet reached max limit
    By legolas in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 12-14-2011, 06:56 PM

Tags for this Thread

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