+ Reply to Thread
Results 1 to 2 of 2

Assigning incremental values within a range of data with same ids if a criteria is met

  1. #1
    Registered User
    Join Date
    07-19-2016
    Location
    Montreal, Quebec
    MS-Off Ver
    2013
    Posts
    4

    Assigning incremental values within a range of data with same ids if a criteria is met

    Hello !

    I am trying to assign an incremental value to a row in the case the value = "PFR" or "PFA". So for all instances of PFR or PFA I would like to assign the numbers 1, 2, 3, 4 and so on (depending on how many there are) within the same id number. In the case it doesn't find PFA or PFR I would assign 0. The counter would have to reset every time the ID changes.

    Below is an example of the result i'm looking for.

    ID Status Decision count
    1 CAD 0
    1 PFA 1
    1 RCA 0
    1 PFR 2
    1 PCF 0
    1 PFR 3
    1 PCF 0
    2 CAD 0
    2 PFA 1
    2 PCF 0
    2 PCV 0
    2 RCA 0
    2 PFR 2
    2 PCV 0
    2 PCV 0
    2 PFR 3
    2 PBI 0
    2 SIN 0
    2 PFR 4

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,379

    Re: Assigning incremental values within a range of data with same ids if a criteria is met

    Hi Frenzilli,

    I think you are looking for this formula.

    =COUNTIFS(A$1:A2,A2,B$1:B2,B2)-1

    Your example doesn't show the correct answers for count if I understand the question. See the attached.
    Countifs Restart with ID.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ 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. Assigning point values to a range
    By april1028 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-27-2015, 03:41 PM
  2. Formula for assigning points for incremental values
    By mashley in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-04-2008, 01:52 PM
  3. [SOLVED] Problem assigning values to a range of cells
    By John Keith in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-07-2005, 04:05 PM
  4. [SOLVED] Assigning ranges for values (e.g., $1,005 the range is ">$1K to 5K
    By jennifer in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  5. Assigning ranges for values (e.g., $1,005 the range is ">$1K to 5K
    By Arvi Laanemets in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 AM
  6. Assigning ranges for values (e.g., $1,005 the range is ">$1K to 5K
    By jennifer in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  7. [SOLVED] Assigning ranges for values (e.g., $1,005 the range is ">$1K to 5K
    By jennifer in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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