+ Reply to Thread
Results 1 to 9 of 9

If, iferror, indirect

  1. #1
    Registered User
    Join Date
    06-24-2019
    Location
    Sweden
    MS-Off Ver
    Office 16
    Posts
    49

    If, iferror, indirect

    Hello!

    Ive a little problem solving this code:

    excel2.jpg

    =IF(H74=5;INDIRECT("'["&L75&"]"&M75&"'!"&N75);IF(H74=6;INDIRECT("'["&L76&"]"&M76&"'!"&N76)))


    Point of my code is:

    If current date is 5 or 6 and so on is about to be added, it should point to another workbook(hej.xlsm), and a new sheet with the current date (Sheet5,6 and so on), and cell A1.

    What i want to do this when the date changes to the next sheet, that sheet is not yet created and gives an error. Is it possible to lets say if today midnight date switches to 8 and Sheet8 is not yet created - Can it be redirected to previous sheet (Sheet7) until Sheet8 is created?

    Best regards

    wizzan1

  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 2406
    Posts
    44,231

    Re: If, iferror, indirect

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? However, please give us an indication of the approximate number of rows of data you want the solution to work with (100, 1000, 100,000 or whatever). Please don't attach a picture of an Excel sheet (no-one will want to re-type all your stuff before starting).

    1. It does NOT have to be your real sheet - mock up a SAMPLE if you need to. But not 1000's of rows!!! It makes manual checking so tedious. Whatever you do... make sure that all confidential information is removed first!!

    2. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    3. Make sure that your desired solution is also shown (mock up the results manually).

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    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

  3. #3
    Registered User
    Join Date
    06-24-2019
    Location
    Sweden
    MS-Off Ver
    Office 16
    Posts
    49

    Re: If, iferror, indirect

    Ok so in Book1, Sheet1, when the date changes inB2 it should return the number in F13 from A1 in hej.xlsm. But Sheet9 is not yet created. so when the Date changes to 9, I want it to point to the previous sheet(Sheet8) until Sheet 9 is created.

    Let me know if unclear

    Best regards
    Attached Files Attached Files
    Last edited by AliGW; 07-07-2019 at 03:54 PM.

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

    Re: If, iferror, indirect

    Open both files in the same place. try it out. If it's OK, I'll explain what's going on.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-24-2019
    Location
    Sweden
    MS-Off Ver
    Office 16
    Posts
    49

    Re: If, iferror, indirect

    I've opened them, i dont understand it completely but a little. It gives me a REF error whatever Date number i fill in.

    Regards
    Attached Files Attached Files
    Last edited by AliGW; 07-07-2019 at 03:55 PM.

  6. #6
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,573

    Re: If, iferror, indirect

    Administrative Note:

    Please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.
    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.

  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 2406
    Posts
    44,231

    Re: If, iferror, indirect

    Did you enable macros on both sheets, when opening?

  8. #8
    Registered User
    Join Date
    06-24-2019
    Location
    Sweden
    MS-Off Ver
    Office 16
    Posts
    49

    Re: If, iferror, indirect

    Yes they are both macro-enabled worksheets.

  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 2406
    Posts
    44,231

    Re: If, iferror, indirect

    Try it now...

    I am assuming that it failed in MY demo files and that you have not raced ahead and copied the formulae into your real sheet...

    If the two files attached here fail:

    1. What do you see in hej, dataA1:A12

    2. What do you see in Book1 G3:G11

    3. What formula do you see in Book1 G3

    and then step thorugh the formula in Book1, f13, using formulas/evaluate formula and transcribe the LAST line before you get he error message and first one after it.
    Attached Files Attached Files

+ 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. Iferror / Indirect - formula not working
    By CXMACLEOD in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-18-2019, 05:02 PM
  2. Replies: 4
    Last Post: 08-17-2016, 04:06 PM
  3. iferror / indirect substitute not working?
    By nimv1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-24-2016, 09:33 PM
  4. [SOLVED] IFERROR(MATCH & IFERROR(SMALL Help Needed
    By chad328 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 01-17-2016, 06:34 AM
  5. Simplify The Indirect, AverageIFs and IFError Formula
    By Suis in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-05-2014, 05:13 AM
  6. xlfn.IFERROR or IFERROR don't work in Excel 98-2003
    By dj_danu01 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2013, 02:53 AM
  7. Replies: 1
    Last Post: 07-19-2012, 05:36 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