+ Reply to Thread
Results 1 to 5 of 5

Excel 2008 : Setting up logical compare conditions

  1. #1
    Registered User
    Join Date
    07-27-2010
    Location
    NC
    MS-Off Ver
    Excel 2008
    Posts
    3

    Setting up logical compare conditions

    I have a project to make a business sales spreadsheet and I have all of the problems covered, but 2.

    1.I need to compare 4 weeks of profit to see which week is the best and worst week. I named the range of cells for each week (week1profit, week2profit, etc.) but when I try to compare them with if(and I get nothing. Is there a better way? (What I wrote is way to long to copy and paste here but a nudge in the right direction would be appreciated)

    2.Another similar thing only I need to compare 3 months profits and see which is max and min.
    My code I tried:
    =IF(AND(E31>E50, E31>E69,),E31, IF(E50>E31, E50>E69,),E50,E69)

    But I keep getting errors and excel won't even let me enter this. These particular cells are a monthly total based on =sum(week1profit)+sum(week2profit),etc. if that helps.

    Thanks
    Neil

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Setting up logical compare conditions

    Re #2: It's full of syntax errors

    try
    =IF(AND(E31>E50, E31>E69),E31, IF(and(E50>E31, E50>E69),E50,E69))

    Instead of nesting IFs, you could also use

    =max(E31,E50,E69)

    Likewise the MIN() function to figure out the minimum value of a list of cells or a range.

    Re #1: Please post a workbook with some sample data and mock up the expected results.

  3. #3
    Registered User
    Join Date
    07-27-2010
    Location
    NC
    MS-Off Ver
    Excel 2008
    Posts
    3

    Re: Setting up logical compare conditions

    Thanks teylen, forgot all about min and max...that was the deal. I am attaching my file for school I'm working on. The formula in A31 is my attempt for the first part of my post (minus an equals sign that excel is stopping.)

    Thanks
    Neil
    Attached Files Attached Files

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,255

    Re: Setting up logical compare conditions

    I believe you want to sum Week1Profit into cell E27 and do the same for the rest of the weeks. Then your formula in Cell A37 needs to be rewritten using the sum cells. The problem may be in your A37 formula you are asking if Week1Profit > Week2Profit. These are ranges of cells and not a single number. This may be the problem

  5. #5
    Registered User
    Join Date
    07-27-2010
    Location
    NC
    MS-Off Ver
    Excel 2008
    Posts
    3

    Re: Setting up logical compare conditions

    So I can't treat a range of cells as one when I name the range in this case week1profit? The professor gave us the outline of the program, we just made-up and filled in the prices and if the items were hot, lame or on sale, etc. Then we answer the other spaces. Since he didn't make a space for a weekly sum, is there a way to do it without showing this amount, as in do it in a "blind" cell?

    Can truthfully say, I'm probably way over thinking this, since this is really a basic, basic intro to computers class. Seems they would make it pretty easy.

    Thanks
    Neil

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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