+ Reply to Thread
Results 1 to 6 of 6

Problem using IF and AND functions correctly / effectively in a formula

  1. #1
    Registered User
    Join Date
    01-28-2016
    Location
    Los Angeles
    MS-Off Ver
    Excell for mac 2011
    Posts
    13

    Problem using IF and AND functions correctly / effectively in a formula

    Hello Again....

    I am attempting to define class position as seen in Column P.

    Where there is a "DNF" the competitor did not finish the race and consequently does not have a class position. However he does get one point for starting the race as stated in column Q.

    By using the IF/AND functions in a formula in column P, the formula will ignore the cell above it if it contains DFL, and will go to the one above that in order to continue to count down the positions. Note that the countdown also resets itself as the class changes as defined in Column H.

    The problem for me arises when there are 2 "DNF"s next to each other (P21 & P22), then the formula no longer works. see code below...

    Please Login or Register  to view this content.
    I then modified it to ignore the 2 cells above if they both contain "DNF"s however it is not working....

    Please Login or Register  to view this content.
    I have attached the Sheet for you review, please note that the first formula resides in column P with the exception of P23 that has the second formula. note that when the formula from P23 is added to cell P18 it returns the wrong number count...

    The sheet as downloaded is showing the desired result but this I due to the 2 formulas being used I need to figure out one formula the gives the same result.


    Any help with this would be greatly appreciated!!

    Forum Cup Race sheet.xls
    Last edited by Bermudez; 02-15-2016 at 06:20 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Problem using IF and AND functions correctly / effectively in a formula

    I think a COUNTIFS function could work.

    In column P, this counts the the cells above if they are in the same class and not equal to DNF or 0. Then adds one to that count. The formula goes in P6. The references to $P$5:P5 is intentional.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    01-28-2016
    Location
    Los Angeles
    MS-Off Ver
    Excell for mac 2011
    Posts
    13

    Re: Problem using IF and AND functions correctly / effectively in a formula

    Wow... AlphaFrog that is almost working.... See attached Sheet..... There is no first place in P6 or P26 although there seem to be first places in other places that are correct.

    Forum 2.xls

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Problem using IF and AND functions correctly / effectively in a formula

    Change this bit...

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-28-2016
    Location
    Los Angeles
    MS-Off Ver
    Excell for mac 2011
    Posts
    13

    Re: Problem using IF and AND functions correctly / effectively in a formula

    AlphaFrog - Thank you, that worked!!!! You are a godsend!!

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Problem using IF and AND functions correctly / effectively in a formula

    You're welcome. Thanks for the feedback.

+ 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: 12
    Last Post: 06-24-2015, 02:00 PM
  2. Problem with getting all the information I need imported correctly
    By THRASHER69 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-27-2014, 12:12 PM
  3. Problem with files not saving correctly
    By Mr.Pinches in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2011, 11:30 AM
  4. Replies: 2
    Last Post: 06-15-2010, 06:05 AM
  5. [SOLVED] Nestling of functions
    By Tomas Stroem in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-25-2006, 07:45 PM
  6. Nestling functions
    By Tomas Stroem in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-18-2006, 06:10 AM
  7. [SOLVED] My control toolbox functions are not working correctly.
    By NUMBnut in forum Excel General
    Replies: 0
    Last Post: 01-10-2006, 11:40 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