+ Reply to Thread
Results 1 to 5 of 5

If-Then Excel Logic question

  1. #1
    Registered User
    Join Date
    09-15-2014
    Location
    Kansas
    MS-Off Ver
    2011 (Mac)
    Posts
    14

    Question If-Then Excel Logic question

    Hello,

    I am new to this forum and I apologize if this is a question that has previously been submitted. Here is the breakdown of what I would like to accomplish:

    1. What I have: There are three columns. The first is a list of student names (sometimes repeated dependent on the third). The second is a list of corresponding class names they are registered in (also repeated dependent on the third column). The third is a list of attendance records by day.

    2. What I would like to do: I wish to write a general formula that identifies that if both the row cells in column 1 (Names) are the same AND the row cells in column 2 (Class) are the same, then the numbers in column (3) need to averaged for those matched rows.

    I've included an example set that may help visualize what I'm trying to do. So as an example, the formula would identify Drake, Janie from the first column AND Math 101 from the second column and then average the corresponding values (5/5 = 1). The formula would identify Drake, Janie from the first column AND Chem 101 from the second column and then average the corresponding values (2/5 = 0.4). Etc.

    Thanks ahead for your help.
    Attached Files Attached Files

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: If-Then Excel Logic question

    Hi olgratefuldead,
    Welcome to the Forum.

    Try this.....

    In D2
    Please Login or Register  to view this content.
    Does this help?
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Registered User
    Join Date
    09-15-2014
    Location
    Kansas
    MS-Off Ver
    2011 (Mac)
    Posts
    14

    Re: If-Then Excel Logic question

    Yes it does. Thank you. But how can do it for a list for 6000 entries? When I try to amend the formula you've provided for any length greater than 100, it won't let me and defaults to 100.

    e.g. I have this: =IF(A2&B2=A1&B1,"",AVERAGEIFS($C$2:$C$100,$A$2:$A$100,A2,$B$2:$B$100,B2))

    but if I try this: =IF(A2&B2=A1&B1,"",AVERAGEIFS($C$2:$C$6000,$A$2:$A$6000,A2,$B$2:$B$6000,B2)), it will default to the above.

    Is there just a way to make the formula work for an infinite list? That would take care of my problem too. Thanks again.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: If-Then Excel Logic question

    It shouldn't be an problem. I copied your formula into a blank sheet and had no issues.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    09-15-2014
    Location
    Kansas
    MS-Off Ver
    2011 (Mac)
    Posts
    14

    Re: If-Then Excel Logic question

    You're correct. Now it works. I obviously made a mistake somewhere. Thanks for your and sktneer's help!

+ 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. Excel Formula Question - Logic cycle
    By DrShlick in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-16-2013, 03:55 PM
  2. Excel Logic Question - Interpreting data
    By nobodyukno in forum Excel General
    Replies: 3
    Last Post: 07-23-2013, 06:14 PM
  3. Basic Excel If Logic Question
    By ffmariners in forum Excel General
    Replies: 7
    Last Post: 04-24-2010, 08:27 PM
  4. Logic question
    By rhyan66 in forum Excel General
    Replies: 3
    Last Post: 02-18-2009, 05:08 PM
  5. a basic question about excel logic
    By jPaulB in forum Excel General
    Replies: 2
    Last Post: 04-21-2008, 01:43 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