+ Reply to Thread
Results 1 to 10 of 10

Getting an error code when trying to add more conditions/columns to an IF statement

  1. #1
    Registered User
    Join Date
    05-12-2022
    Location
    USA
    MS-Off Ver
    2013
    Posts
    9

    Question Getting an error code when trying to add more conditions/columns to an IF statement

    QUERY UPDATED AND CLARIFIED

    This is the first time I've worked with more than 1 formula in a cell at a time and also the first time I've tried to work across sheets. I got the template from someone else and I'm having serious trouble modifying it to do what I want. I am working with the following formula in each calendar cell on the second sheet:

    =IFERROR(INDEX(Data!$E:$E,SMALL(IF(Data!$F$1:$F$10012<=INDEX(D:D,INT(ROW()/4)*4),IF(Data!$G$1:$G$10012>=INDEX(D:D,INT(ROW()/4)*4),IF(Data!$A$1:$A$10012=$C$1,ROW(Data!$F$1:$F$10012)))),MOD(ROW(),4))),"")

    I have a drop down list at the top of the page that allows me to sort by a certain characteristic that lives in column A on the Data sheet. It then populates a calendar with everything that meets those conditions in the specified date range (that part is fine and works great). My problem is that I want to add more conditions for it to meet. Instead of just column A, I need it to look in columns A, B, C, and D and return results that match all of the selected criteria. I already made it so that the dropdown menu can have multiple selections, but the problem is the code in the boxes doesn't know how to look in the other columns to find those selections.

    A specific example: I want to select items assigned to Test A, Level 2, in the Test Development department (it would be even better if I could select items assigned to Test A, Levels 1 OR 2, in the test development OR editing departments, but that seems a whole lot more complicated so maybe I'm asking for too much)

    I thought it would just be copy and pasting "IF(Data!$A$1:$A$10012=$C$1" multiple times and updating A to be the different columns I want. However, this did not work. I keep getting errors, but it won't tell me why or how to fix it. "Evaluate formula" just adds a bunch of 0's to the formula and doesn't explain anything. I have been reading forums for hours and I am nowhere closer to understanding what is happening.

    I am open to adding more drop down lists so each criteria has its own cell at the top if that would make things easier. I just don't really know what I'm doing (obviously)
    Attached Files Attached Files
    Last edited by AliGW; 05-13-2022 at 12:34 PM.

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: Create a calendar that look like a calendar that can be filtered

    a couple of variations on a theme that you may be able to adapt.
    do not type entries into cells - double click the cell and a data entry form will appear.
    if of interest post back on this site.
    Attached Files Attached Files
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Registered User
    Join Date
    05-12-2022
    Location
    USA
    MS-Off Ver
    2013
    Posts
    9

    Re: Create a calendar that look like a calendar that can be filtered

    These look super cool and I think I could make the perpetual diary one work for what I want. I'm just a little confused about how it works. I get a "compile error" every time I click a cell then it opens up a big command window. It highlights one line and puts an arrow, but idk what I'm supposed to do there. I can't tell where I'm supposed to put my information. Like what part of this huge *** formula is where I input the name and date and team?

    I think this is just way beyond my excel knowledge (which is mostly just raw data and sorting, rarely any functions/formulas)

  4. #4
    Registered User
    Join Date
    05-12-2022
    Location
    USA
    MS-Off Ver
    2013
    Posts
    9

    Re: Create a calendar that look like a calendar that can be filtered

    Ok I think I did this attachment thing right. I have more info for you all because I have been frantically searching the internet for answers. I've come across a few things, but this is the most promising/closest to what I want.

    My biggest issue is with the limited sort function. I need to be able to sort multiple things at a time. I need to be able to sort by what exam, what level, and what department. The goal would be for people to be able to sort things such as:
    - An editor wants to see all editing deadlines for Level 1
    - A publisher wants to see all deadlines related to Levels 1 and 2, but not Level 3
    - A manager wants to see all Item Writing Workshops for all levels

    Is something like that possible? Is there a way to build off the existing sheet to do that? I added a sheet that shows what I'm imagining as my data points. I don't understand how any of the formulas work and what information I would need to add/change to get to this point.

    Bonus: It would be great if I had 12 sheets (1 for each month) instead of 1 that I have to manually change the month on

    Edit #2: I've been playing with this and I now have a very specific spot where I'm stuck. Right now the boxes populate using this formula:

    =IFERROR(INDEX('What I Have'!$E:$E,SMALL(IF('What I Have'!$F$1:$F$10012<=INDEX(D:D,INT(ROW()/4)*4),IF('What I Have'!$G$1:$G$10012>=INDEX(D:D,INT(ROW()/4)*4),IF('What I Have'!$A$1:$A$10012=$C$1,ROW('What I Have'!$F$1:$F$10012)))),MOD(ROW(),4))),"")

    It currently tries to match what is in cell C1 with anything in column A on the other sheet. What I need to do is isolate which part of this formula is doing that and duplicate it for other columns. E.g. In D1 I would have drop downs for column 2, E1 would have dropdowns for column C. Then it would be able to populate the cells with all things that meet those 3 criteria.
    Attached Files Attached Files
    Last edited by thisisbullsht; 05-12-2022 at 04:45 PM.

  5. #5
    Registered User
    Join Date
    05-12-2022
    Location
    USA
    MS-Off Ver
    2013
    Posts
    9

    Question Deleted

    I made a post a few hours ago that I think was just too big/vague. I needed more answers/work than 1 person should have to provide for free. Since then I have been working furiously on this and have found a spreadsheet that functions in somewhat the way I want. I now have a very specific spot where I'm stuck. Right now the boxes on the event sheet populate using this formula:

    =IFERROR(INDEX(Data!$E:$E,SMALL(IF(Data!$F$1:$F$10012<=INDEX(D:D,INT(ROW()/4)*4),IF(Data!$G$1:$G$10012>=INDEX(D:D,INT(ROW()/4)*4),IF(Data!$A$1:$A$10012=$C$1,ROW(Data!$F$1:$F$10012)))),MOD(ROW(),4))),"")

    There is currently a dropdown menu in C1 that aligns with items in column A and the above formula is what matches the content and populates a cell. What I need to do is isolate which part of this formula is doing that and duplicate it for other columns. In D1 I would have drop downs for column B, E1 would have dropdowns for column C, etc...Then when I make my choices it would populate the cells with all things that meet those all of those criteria. It would also be great if it was checkboxes like a pivot table instead of a single selection (e.g. instead of being limited to only Level 1 or Level 2 items, I could see both together).
    Last edited by AliGW; 05-13-2022 at 12:31 PM. Reason: Post reinstated.

  6. #6
    Registered User
    Join Date
    05-12-2022
    Location
    USA
    MS-Off Ver
    2013
    Posts
    9

    Create a calendar that look like a calendar that can be filtered

    Excel 2013 - NO ACCESS TO 365

    This is the first time I've worked with more than 1 formula in a cell at a time and also the first time I've tried to work across sheets. I got the template from someone else and I'm having serious trouble modifying it to do what I want. I am working with the following formula in each calendar cell on the second sheet:

    =IFERROR(INDEX(Data!$E:$E,SMALL(IF(Data!$F$1:$F$10012<=INDEX(D:D,INT(ROW()/4)*4),IF(Data!$G$1:$G$10012>=INDEX(D:D,INT(ROW()/4)*4),IF(Data!$A$1:$A$10012=$C$1,ROW(Data!$F$1:$F$10012)))),MOD(ROW(),4))),"")

    I have a drop down list at the top of the page that allows me to sort by a certain characteristic that lives in column A on the Data sheet. It then populates a calendar with everything that meets those conditions in the specified date range (that part is fine and works great). My problem is that I want to add more conditions for it to meet. Instead of just column A, I need it to look in columns A, B, C, and D and return results that match all of the selected criteria. I already made it so that the dropdown menu can have multiple selections, but the problem is the code in the boxes doesn't know how to look in the other columns to find those selections.

    A specific example: I want to select items assigned to Test A, Level 2, in the Test Development department (it would be even better if I could select items assigned to Test A, Levels 1 OR 2, in the test development OR editing departments, but that seems a whole lot more complicated so maybe I'm asking for too much)

    I thought it would just be copy and pasting "IF(Data!$A$1:$A$10012=$C$1" multiple times and updating A to be the different columns I want. However, this did not work. I keep getting errors, but it won't tell me why or how to fix it. "Evaluate formula" just adds a bunch of 0's to the formula and doesn't explain anything. I have been reading forums for hours and I am nowhere closer to understanding what is happening.

    I am open to adding more drop down lists so each criteria has its own cell at the top if that would make things easier. I just don't really know what I'm doing (obviously)
    Attached Files Attached Files

  7. #7
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: Create a calendar that look like a calendar that can be filtered

    hopefully @PeteUK may see this post and help you - he has far more experience than I with calendars embeded with formula.
    I tend to steer away from on sheet formula and take the path of VBA code solutions.

  8. #8
    Registered User
    Join Date
    05-12-2022
    Location
    USA
    MS-Off Ver
    2013
    Posts
    9

    Re: Create a calendar that look like a calendar that can be filtered

    Unfortunately VBA code is way beyond my capabilities. I tried that at first because someone sent me a template that used it, but I've never used it before and got super lost. Coding is definitely not my specialty But I appreciate the call out to Pete! Maybe he will see this and be able to tell me where I'm going wrong

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2509 (Windows 11 Home 24H2 64-bit)
    Posts
    92,406

    Re: Create a calendar that look like a calendar that can be filtered

    You have been asked to keep everything in this thread.

    Your new posts have been copied here. If you wish to update the title of the opening post in this thread, then by all means do so. (EDIT: I've done it for you.)

    Thank you for your co-operation.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2509 (Windows 11 Home 24H2 64-bit)
    Posts
    92,406

    Re: Getting an error code when trying to add more conditions/columns to an IF statement

    Please STOP deleting posts! Leave everything as it is. Thank you.

+ 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: 9
    Last Post: 04-20-2021, 02:17 PM
  2. [SOLVED] Return Fiscal calendar month, year and period, based on calendar date
    By losincog in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-20-2020, 09:16 AM
  3. Replies: 4
    Last Post: 11-11-2019, 01:42 PM
  4. Calendar in Excel which can be filtered.
    By X82 in forum Excel General
    Replies: 5
    Last Post: 11-24-2016, 05:05 AM
  5. Excel Calendar Filtered Data
    By tav123456 in forum Excel General
    Replies: 0
    Last Post: 07-05-2013, 03:55 PM
  6. Calendar VBA auto filling week and month based on calendar entry.
    By perrymagic in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2011, 02:00 PM
  7. Replies: 0
    Last Post: 03-27-2008, 04:36 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