+ Reply to Thread
Results 1 to 12 of 12

Conditional Formatting - Last Occurrence

Hybrid View

  1. #1
    Registered User
    Join Date
    09-06-2019
    Location
    KL, Malaysia
    MS-Off Ver
    Microsoft Office 2013
    Posts
    5

    Smile Conditional Formatting - Last Occurrence

    Hi there,

    I need some help, a bit stuck here.

    1 2 3 4 5
    A 40 45 70 78 87

    I put this formula down to find the first occurrence thats greater than 50
    =COUNTIF($A$1:A1,">"&50)=1 and it worked to pick up the first occurrence more than 50.

    But now I want to pick up the last occurrence less than 50. Countif doesnt seem to work and I am kinda stuck now...

    Anyone can help?

  2. #2
    Forum Contributor
    Join Date
    04-15-2015
    Location
    beirut
    MS-Off Ver
    2010
    Posts
    107

    Re: Conditional Formatting - Last Occurrence

    See this file Please
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    09-06-2019
    Location
    KL, Malaysia
    MS-Off Ver
    Microsoft Office 2013
    Posts
    5

    Re: Conditional Formatting - Last Occurrence

    Salim Ali - thanks for helping out but I am not sure how to apply array formula in conditional formatting...

  4. #4
    Forum Contributor
    Join Date
    04-15-2015
    Location
    beirut
    MS-Off Ver
    2010
    Posts
    107

    Re: Conditional Formatting - Last Occurrence

    Quote Originally Posted by jagsnumpty View Post
    Salim Ali - thanks for helping out but I am not sure how to apply array formula in conditional formatting...
    Formulas for cond.format (directly in Dialog Box without Ctrl+Shift+Enter)
    and the cell a2 must me the active cell
    *-last number
    =$A2=LOOKUP(MAX($A$2:$A$20)+1,IF($A$2:$A$20<=$F$1,$A$2:$A$20),$A$2:$A$20)
    *- first number
    =$A2=INDEX($A$2:$A$20,MATCH(TRUE,IF($A$2:$A$20<=$F$1,TRUE,FALSE),0))

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,788

    Re: Conditional Formatting - Last Occurrence

    How about
    =COUNTIF($A$1:$A2,">=50")=1

  6. #6
    Registered User
    Join Date
    09-06-2019
    Location
    KL, Malaysia
    MS-Off Ver
    Microsoft Office 2013
    Posts
    5

    Re: Conditional Formatting - Last Occurrence

    No, this doesnt work....

  7. #7
    Forum Contributor
    Join Date
    04-15-2015
    Location
    beirut
    MS-Off Ver
    2010
    Posts
    107

    Re: Conditional Formatting - Last Occurrence

    Quote Originally Posted by jagsnumpty View Post
    No, this doesnt work....
    See this file
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,788

    Re: Conditional Formatting - Last Occurrence

    Are you referring to me, or to salim ali?

    Also what does "doesnt work" mean?
    Can you please supply a sample workbook showing your data.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  9. #9
    Registered User
    Join Date
    09-06-2019
    Location
    KL, Malaysia
    MS-Off Ver
    Microsoft Office 2013
    Posts
    5

    Re: Conditional Formatting - Last Occurrence

    Sorry, i meant both of the formula Fluff13 & Salim provided aren't working for me.

    My row of data comes in sequence. Refer to my file, in this case, I want to find the the last number that is less than cell yellow, which is March - 34.

    I can find the first time its more than cell yellow, just need to flip this...
    Attached Files Attached Files

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,788

    Re: Conditional Formatting - Last Occurrence

    Ok, thanks for the file, try
    =COUNTIF($B$2:C$2,">="&$J$1)=1
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    09-06-2019
    Location
    KL, Malaysia
    MS-Off Ver
    Microsoft Office 2013
    Posts
    5

    Re: Conditional Formatting - Last Occurrence

    Quote Originally Posted by Fluff13 View Post
    Ok, thanks for the file, try
    =COUNTIF($B$2:C$2,">="&$J$1)=1
    BAMMM! This works! Thanks very much!!!!

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,788

    Re: Conditional Formatting - Last Occurrence

    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: 16
    Last Post: 08-19-2019, 08:00 AM
  2. Find the Occurrence and Result of each occurrence
    By suriya0702 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-21-2019, 01:43 PM
  3. Replies: 2
    Last Post: 02-20-2019, 05:09 PM
  4. [SOLVED] Override conditional formatting (in general, without changing the conditional formatting)
    By Stormin' in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-21-2017, 07:15 AM
  5. Find each occurrence in a column and do for each occurrence
    By jfoerch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-21-2014, 12:29 PM
  6. Conditional formatting first occurrence in a row
    By hotelmrrsn in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-11-2014, 01:52 PM
  7. Opening xlsm files with conditional formatting opens with removed conditional formatting
    By Martijn.Steenbakker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:38 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