+ Reply to Thread
Results 1 to 10 of 10

If statement searching for highlighted cells???

  1. #1
    Registered User
    Join Date
    12-03-2007
    Posts
    6

    If statement searching for highlighted cells???

    Would like to write an IF statement where it reads if any cells in a column are highlighted and gives the sum of those highlighted while ignoring the ones unhighlighted.

    Is there any way to do this or an alternate method that would possibly work???

    Thanks

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    If the highlights are results of Conditional Formatting, then perhaps you can do it with formulas...otherwise you will need VBA.

    Which is it? If with formulas, please state the formula.

    If with VBA...hopefully someone else can help.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    12-03-2007
    Posts
    6
    no conditional formatting. I am highlighting the cells in the column manually and was hoping there was a way to have them added as they are highlighted. Maybe there is a better way to go about this rather then highlighting?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    What makes you highlight the cells? Is there a certain condition that can be applied to base your highlighting on?

  5. #5
    Registered User
    Join Date
    12-03-2007
    Posts
    6
    I am running a college football bowls contest where each participant had to select a confidence factor (1-32) for each of the 32 bowl games. The confidence factor represents the point total for each correct selection.

    I dont want to grade it by hand, so I am trying to figure out the best way to have excel grade it for me. The Highlighting is for a correct selection. Maybe there is a better way of going about it? Example is attached.
    Attached Files Attached Files

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    So what makes the selection correct?

    If it is arbitrary, then one way might be to add another column and put a "Y" (without quotes) for correct (and if you desire an "N" for incorrect) instead of highlighting...then use a Countif formula to count the "Y"'s..

    e.g. =Countif(H4:H35,"Y")

    assuming you put the "Y's" in column H.

    Can this work?

  7. #7
    Registered User
    Join Date
    12-03-2007
    Posts
    6
    a correct selection is if that team won the game or not. If they win, then I highlight, if not, then I dont.

    Correct me if I am wrong, but a countif will just add up the amount of Y's when i need the #'s in column G to be added.

    Like right now I would like to see '16' in cell G39. If Memphis wins tonights game and Cincy wins tomorrow , I would like to be able to highlight cells G5 and G6 and then see '56' in cell G39 because that is 16+15+25.

    I would like to avoid adding an extra column as I have several of these all on one master list and was hoping there was a formula or program that I could put under each entry on that same sheet.

    Thanks for your help.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Sorry, then you can use Sumif

    e.g. =Sumif(H4:H35,"Y",G4:G35)

    this will sum values in G where H has a Y

    If you can't use the extra column...then you'll need VBA to count the highlights.....unfortunately, not my forte...so we'll have to wait for someone with VBA solution....

  9. #9
    Registered User
    Join Date
    12-03-2007
    Posts
    6
    Ok, ill post it in the programming section. Thanks for your help, much appreciated.

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Please also post a link to this thread so people see the connection and don't lock you for duplicate posting.

+ 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