+ Reply to Thread
Results 1 to 14 of 14

correction in countif forumla

  1. #1
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    correction in countif forumla

    Dear expert
    i would like to edit in the formula in column D to make it suitable to to create column F
    the difference is
    when i enter some previous product manual as in F2
    the formula not make correct data as in F4 (corrected data is 160303 not 160302


    also i need if the A column and B is empty leave the cell blank

    the current formula is
    HTML Code: 
    i think its work only from 1
    Attached Files Attached Files
    Last edited by mazan2010; 09-27-2016 at 03:17 AM.

  2. #2
    Forum Contributor
    Join Date
    08-29-2012
    Location
    Slough
    MS-Off Ver
    Excel 2007
    Posts
    469

    Re: correction in countif forumla

    How do you get to the last 2 numbers? How are they worked out? Why is it 02 and not 01?

  3. #3
    Forum Contributor
    Join Date
    08-29-2012
    Location
    Slough
    MS-Off Ver
    Excel 2007
    Posts
    469

    Re: correction in countif forumla

    Your formula is checking if there is the value of A2 in the cell A2. Therefore it shall always be 01.

  4. #4
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: correction in countif forumla

    last two number is coming by order
    meaning if i produce this product first time the number in B2 (16/02 will be 160201) but i produce it before for example will add 1 to previous number ( the number will be 160202 for the same product

    the problem i think this formula must start from zero
    as in my attached example in column F ( i add 160202 in F2 and the formula in F4 the same prouct not give correct number 160302 (correct number is 160303)

  5. #5
    Forum Contributor
    Join Date
    08-29-2012
    Location
    Slough
    MS-Off Ver
    Excel 2007
    Posts
    469

    Re: correction in countif forumla

    =IFERROR(LEFT(B2,2)&RIGHT(B2,2)&TEXT(COUNTIF($A$2:A2,A2-1),"00"),"")

    That will start it from 0

  6. #6
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: correction in countif forumla

    not what i need
    i want expain how this code
    the code consist of number in B2 (16/02) first remove / 1602 and add number according to how many is produced before from the same product
    160201 if first or 160202 if second or 160203 if third and soon 160211 if Eleven and soon

  7. #7
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: correction in countif forumla

    but can't become 160200 as your formula

  8. #8
    Forum Contributor
    Join Date
    08-29-2012
    Location
    Slough
    MS-Off Ver
    Excel 2007
    Posts
    469

    Re: correction in countif forumla

    Your formula is doing that fine with the letter in the first column or do you want the 160302 to be 160202?

  9. #9
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: correction in countif forumla

    No the value in B3 is 16/03 which will be 1603 this value not change with number of product produced , the change will occue only in last two digit according to number of the same product produced before

  10. #10
    Forum Contributor
    Join Date
    08-29-2012
    Location
    Slough
    MS-Off Ver
    Excel 2007
    Posts
    469

    Re: correction in countif forumla

    I don't see the issue then. What is wrong with the formula? You are counting the amount of Xs. Count something else if you want a different value. Can you please clarify what it is that is wrong......

    =IFERROR(LEFT(B2,2)&RIGHT(B2,2)&TEXT(COUNTIF($B$2:B2,B2),"00"),"")

    That is the only thing I can see that might be right.

  11. #11
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: correction in countif forumla

    please see attahced photo
    Attached Images Attached Images

  12. #12
    Forum Contributor
    Join Date
    08-29-2012
    Location
    Slough
    MS-Off Ver
    Excel 2007
    Posts
    469

    Re: correction in countif forumla

    That just shows as a red X. Can you please put in your spreadsheet how you would like it to look.

  13. #13
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,910

    Re: correction in countif forumla

    Try this in F3:

    =IFERROR(LEFT(B3,2)&RIGHT(B3,2)
    &TEXT(IF(COUNTIF($A$2:A3,A3)=1,COUNTIF($A$2:A3,A3),RIGHT(LOOKUP(2,1/($A$2:A2=A3),$F$2:F2),2)+1),"00"),"")

  14. #14
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: correction in countif forumla

    I try but its not working

+ 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. Help with Complex COUNTIF Forumla
    By rojamilo123 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-27-2016, 08:00 AM
  2. CountIF forumla
    By Seagood3 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-17-2015, 12:20 PM
  3. Countif Forumla
    By chubbchubb in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-20-2014, 10:50 AM
  4. How do i convert this countif forumla to VBA
    By supersingh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-25-2012, 06:30 AM
  5. Countif Or sumif forumla
    By masond3 in forum Excel General
    Replies: 4
    Last Post: 07-06-2012, 08:00 AM
  6. CountIF Forumla
    By neil25 in forum Excel General
    Replies: 6
    Last Post: 06-17-2008, 08:20 AM
  7. Forumla Help!countif?IF?If(AND? if(OR?
    By harpscardiff in forum Excel General
    Replies: 6
    Last Post: 01-19-2006, 06:45 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