+ Reply to Thread
Results 1 to 7 of 7

Which car is ahead?

  1. #1
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Dubai
    MS-Off Ver
    Excel For Mac V16 365
    Posts
    145

    Which car is ahead?

    Hiii,

    I have attached a sheet inorder to understand better.

    in the column ahead, i need a formula that can compare the km covered by car a and car b and decide which car is ahead?

    as i come down the array it should sum the previous km covered and then compare.

    Many thanks
    Attached Files Attached Files

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Which car is ahead?

    One way, formula in row 2 and copied down

    =IF(SUM(B$2:B2)=SUM(C$2:C2),"Tie","Car " & IF(SUM(B$2:B2)=MAX(SUM(B$2:B2),SUM(C$2:C2)),"a","b"))
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Which car is ahead?

    Or this:

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


    I think that E4 should return "tie"

  4. #4
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Dubai
    MS-Off Ver
    Excel For Mac V16 365
    Posts
    145

    Re: Which car is ahead?

    Thanks a lot

  5. #5
    Valued Forum Contributor
    Join Date
    10-29-2012
    Location
    Mojokerto,Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    554

    Re: Which car is ahead?

    =INDEX({"car b","tie","car a"},MATCH(SIGN(SUM(B$2:B2)-SUM(C$2:C2)),{-1,0,1}))
    copy down

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Which car is ahead?

    Ghozi, you don't need MATCH function...
    It's enough to add +2 on SIGN result
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Since SIGN can return -1, 0 or 1 by adding +2 you will have 1,2,3 that you can use in your INDEX function.

    Compare to mine solution above.

  7. #7
    Valued Forum Contributor
    Join Date
    10-29-2012
    Location
    Mojokerto,Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    554

    Re: Which car is ahead?

    thank's a lot

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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