+ Reply to Thread
Results 1 to 4 of 4

Help with Conditional Formulas

  1. #1
    Registered User
    Join Date
    12-08-2014
    Location
    Kentucky
    MS-Off Ver
    MS Office 2010 (PC)/ Office 2011 (Mac)
    Posts
    4

    Help with Conditional Formulas

    Hi everyone! I need some desperate help, please! I am in charge of getting high school student schedule data into a certain format for import into a grading program. The problem lies in the raw data I was given in the .csv file. The individual in charge of scheduling didn't put the correct period numbers into the scheduling program, so it shows all kids as being enrolled in first period (we have 7 periods). To fix this, I'm doing some conditional formulas based on the course number and section number, and then having it insert the appropriate period number. For instance... if the course number is "258974" and the section number is "3", then it is supposed to return a value of "3" for third period. The match between section number and period number is coincidental here. I have only done the conditional formula for one teacher's six classes so far, but it doesn't work when populated. It always returns false. I am desperate. I have done every trouble shooting thing I can think of and asked everyone I know what's wrong. I have done a lot of conditional formulas and never really had issues. I think Excel is not realizing that the values in columns C and D match the values specified in the formula.

    Please, please help. I am desperate. I needed to get this done this weekend, and I'm at a loss of what else to do.

    Thank you so, so much!
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,044

    Re: Help with Conditional Formulas

    Hi, welcome to the forum

    1st, remove the "" from all of the real numbers in your formula - you generally only use "" when dealing with text. I can see only 1 "number" that needs them (bolded) in your formula...
    =IF(C2=70743,1,IF(AND(C2=258974,D2=3),3,IF(AND(C2="060112-9",D2=1),5,IF(AND(C2=258974,D2=2),6,IF(AND(C2=258974,D2=1),7,"false")))))

    However, I think I would create a small table for this and then use INDEX/MATCH, something like this...

    J
    K
    L
    M
    N
    5
    1
    2
    3
    4
    6
    70743
    7
    258974
    7
    6
    3
    8
    060112-9
    5


    You would then use this, to pull out the value...
    =IFERROR(INDEX($K$6:$Q$8,MATCH($C2,$J$6:$J$8,0),MATCH($D2,$K$5:$Q$5,0)),FALSE)

    This is obviously a small sample of your data that I used, but the principal holds
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    12-08-2014
    Location
    Kentucky
    MS-Off Ver
    MS Office 2010 (PC)/ Office 2011 (Mac)
    Posts
    4

    Re: Help with Conditional Formulas

    Whew. Thanks for the help. I can't believe the error was the quotation marks. Lord that makes me so mad at myself. I don't quite get the index/match function, so I'm going to read up on it and see if I can figure it out.

    Thanks again!

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,044

    Re: Help with Conditional Formulas

    INDEX/MATCH is not really that scary, once you break it down. You are already familiar with combining formulas to get stuff, and that is no different.

    We start with the INDEX function, which will return the value at the intersection of a given row and column...
    =index(range, row-number, column-number)

    Not so bad huh?

    OK, so all we now need to do is determine the row and column to use, and for that, we call on the MATCH() function. This magical lil guy can be used in exactly the same way both vertically (to find the row number) and horizontally (to find the column number)

    =MATCH(criteria-to-find,column-range-to-search-in,0) 0 returns exact match
    =MATCH(criteria-to-find,row-range-to-search-in,0)

    So in my example above....
    INDEX($K$6:$Q$8,MATCH($C2,$J$6:$J$8,0),MATCH($D2,$K$5:$Q$5,0))
    I have used the range $K$6:$Q$8 as the index range
    then to find the row and column...
    MATCH($C2,$J$6:$J$8,0) for the row number
    and
    MATCH($D2,$K$5:$Q$5,0)) for the column number

    Finally, I wrapped the whole thing in IFERROR to catch any error that would show up when the data was not found

    I hope that helps explain it a bit, if not, shout and I will try again

+ 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. Conditional Formulas
    By dizjackson in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-14-2013, 02:54 PM
  2. Excel 2007 : Conditional formulas
    By CaramelFishy in forum Excel General
    Replies: 6
    Last Post: 08-14-2011, 12:33 AM
  3. Conditional Formulas
    By haxmania1 in forum Excel General
    Replies: 15
    Last Post: 11-17-2008, 02:52 AM
  4. [SOLVED] conditional formulas
    By Beth104 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-08-2006, 11:15 AM
  5. [SOLVED] Conditional formulas
    By billservit in forum Excel General
    Replies: 4
    Last Post: 05-07-2005, 08:07 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