+ Reply to Thread
Results 1 to 10 of 10

apply formula if number is the last repeat

  1. #1
    Registered User
    Join Date
    08-24-2017
    Location
    DUBAI UAE
    MS-Off Ver
    2021
    Posts
    79

    apply formula if number is the last repeat

    Guys Greetings for the day.

    I'm looking for a formula to be used on the attached workbook in the "S" column that can apply the given formula "=IF(Q4=0,0,L4+Q4-M4)-R4" only if the item code on "H" column is the last repeat of the sequence.

    because I need to highlight the variance quantity on the "S" row referring to the "H" column items number just for each unique item code and the repeated numbers will return empty results.

    I have attached the screenshot example as well as the workbook for reference.

    DSMR Report.xlsm

    232237253723587.jpg

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: apply formula if number is the last repeat

    Try:
    =IF(H3="","",IF(COUNTIF(H$3:H3,H3)=COUNTIF(H:H,H3),IF(Q3=0,0,L3+Q3-M3)-R3,""))
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    08-24-2017
    Location
    DUBAI UAE
    MS-Off Ver
    2021
    Posts
    79

    Re: apply formula if number is the last repeat

    @Glenn Kennedy this is for sure brilliant, it's an amazing result bro.

    thank you so much and keep safe brother

  4. #4
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: apply formula if number is the last repeat

    Another option:

    Please try in S3 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: apply formula if number is the last repeat

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please click on "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: apply formula if number is the last repeat

    Quote Originally Posted by HansDouwe View Post
    Another option:
    I thought of that, too... but it REQUIRES the data to be sorted. It might be.. but who knows.

  7. #7
    Registered User
    Join Date
    08-24-2017
    Location
    DUBAI UAE
    MS-Off Ver
    2021
    Posts
    79

    Re: apply formula if number is the last repeat

    i did already thank you brother much appreciated

  8. #8
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: apply formula if number is the last repeat

    You didn't say anything about my solution in Post #4 (posted at the same time as your post #3)

  9. #9
    Registered User
    Join Date
    08-24-2017
    Location
    DUBAI UAE
    MS-Off Ver
    2021
    Posts
    79

    Re: apply formula if number is the last repeat

    Quote Originally Posted by HansDouwe View Post
    You didn't say anything about my solution in Post #4 (posted at the same time as your post #3)
    @HansDouwe thank you so much for offering the solution I really appreciate that as well. but the solution of @Glenn Kennedy is much more suitable because of the filtering that I might be doing on the data and that was taken into consideration thankfully.

  10. #10
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: apply formula if number is the last repeat

    Thanks for the feedback.

    If you filter the data, my formula and the formula of Glenn will return the same results.
    Only when you sort the table in a different way our formulas differs.

+ 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. [SOLVED] How to combine a formula to repeat and get the number of times
    By choletseng in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-09-2021, 04:35 AM
  2. [SOLVED] Apply VBA Code to 2 Columns, then skip one and repeat.
    By Ernestas98 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-29-2020, 12:21 PM
  3. Excel Formula: repeat number over set number of columns
    By RequestGuruHelp in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-22-2015, 09:07 AM
  4. [SOLVED] VBA: repeat a formula a number of times
    By dinahajjar in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-24-2013, 11:03 AM
  5. Repeat number formula
    By yendaley in forum Excel General
    Replies: 4
    Last Post: 02-16-2011, 11:38 AM
  6. [SOLVED] repeat a formula same column same number of rows apart
    By steveo in forum Excel General
    Replies: 2
    Last Post: 07-10-2006, 03:29 AM
  7. [SOLVED] repeat a formula same column same number of rows apart
    By steveo in forum Excel General
    Replies: 1
    Last Post: 07-10-2006, 03:29 AM

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