+ Reply to Thread
Results 1 to 29 of 29

unique number formula

  1. #1
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    unique number formula

    I would like a formula which finds the unique number(which appears one time only) and extract him at C1. thanks so much guys!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: unique number formula

    Loius - as you have been told before, you need to tell us what your expected result is in C1. What is it based on this sample data? What happens if there is more than one unique number?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: unique number formula

    imagine a random generator which extracts numbers,so at some time in the box there is only one unique number and i want it at C1

    can you help me?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: unique number formula

    And what is the expected result in your sample file? Is it 23? Please answer the questions asked of you - it will save SO much time.

  5. #5
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: unique number formula

    sorry i make a mistake , please see attached a new table,my expected result in that case is 9 but generally the expected result is the unique number in a box which exists only ones

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: unique number formula

    It can be done in Power Query using this M code:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: unique number formula

    is there any more simple formula,please?

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: unique number formula

    It can't be done with a simple formula as far as I can see. Someone else may be able to help.

  9. #9
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: unique number formula

    dear Ali, i know that you are very proffesional and thanks you! but that is very complicated for me

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: unique number formula

    It isn't difficult and I can talk you through it IF you are interested to learn. Are you?

  11. #11
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: unique number formula

    iam not sure my Ali

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: unique number formula

    By the way, which version of Excel are you using? I have just noticed that your profile says 2007 - is that correct?

  13. #13
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: unique number formula

    i think a formula with vlook and count it would work,something like that maybe

  14. #14
    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,025

    Re: unique number formula

    If you are CERTAIN that there is only one unique number:

    this array formula will do that:
    =IFERROR(SMALL(IF(COUNTIF($E$1:$N$11,$E$1:$N$11)=1,$E$1:$N$11),1),"")

    If you are not CERTAIN, this array formula, copied down will list all unique numbers:
    =IFERROR(SMALL(IF(COUNTIF($E$1:$N$11,$E$1:$N$11)=1,$E$1:$N$11),ROWS(C$1:C1)),"")
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 01-20-2019 at 06:04 AM. Reason: Got the formulas the wrong way round!!
    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

  15. #15
    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,025

    Re: unique number formula

    Ooops.

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...

  16. #16
    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,025

    Re: unique number formula

    If you are using a later version of excel, there is a non-array version, too.

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: unique number formula

    Quote Originally Posted by louis128 View Post
    i think a formula with vlook and count it would work,something like that maybe
    No, not as simple as that. OK, I take it that means you are not going to tell us if you are using Excel 2007 or not and that you are not interested in learning Power Query. Over to Glenn!

  18. #18
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: unique number formula

    “A silent mouth is sweet to hear.”my regards! my friend

  19. #19
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: unique number formula

    And what is that meant to mean, Louis? I hope you are not being critical of my questions and attempts to help you. Which version of Excel are you using? Please answer my question. Is it still Excel 2007?

  20. #20
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: unique number formula

    2003 and 2007

  21. #21
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: unique number formula

    thanks ali
    Last edited by louis128; 01-20-2019 at 06:30 AM.

  22. #22
    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,025

    Re: unique number formula

    Luis, take care that you do not "overstep the mark" and get barred from the site. Advice: stop.

  23. #23
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: unique number formula

    Thanks for the confirmation of Excel versions. This means that my PQ suggestion is moot, as you don't have it. Sorry about that - my mistake.

  24. #24
    Banned User!
    Join Date
    09-04-2018
    Location
    cyprus
    MS-Off Ver
    2007
    Posts
    282

    Re: unique number formula

    thanks! alot!

  25. #25
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: unique number formula

    Another option that will find the first unique number in the array.

    =MATCH(1,FREQUENCY(E1:N11,ROW(A1:INDEX(A:A,MAX(E1:N11)))))

    Array confirmed with shift ctrl enter.

    Note that this will only work with positive integers, where Glenn's suggestion will work with negatives and decimals too.

  26. #26
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: unique number formula

    By the way, Glenn - what was the non-array alternative? Just out of curiosity.

  27. #27
    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,025

    Re: unique number formula

    =IFERROR(AGGREGATE(15,6,$E$1:$N$11/(COUNTIF($E$1:$N$11,$E$1:$N$11)=1),ROWS(C$1:C1)),"")

    or

    =IFERROR(AGGREGATE(15,6,$E$1:$N$11/(COUNTIF($E$1:$N$11,$E$1:$N$11)=1),1),"")
    if CERTAIN that there's only 1 unique number.

  28. #28
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: unique number formula

    Thanks - I am still trying to get my head around the AGGREGATE function. Lightbulb moments are longer in the making these days ...

  29. #29
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: unique number formula

    Non-array, or Non-CSE array?

    Surely if the functions used create arrays within the formula then it is an array formula regardless of whether or not it needs to be confirmed as such.

+ 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] Formula to get Unique number of names
    By rizmomin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-07-2019, 10:36 AM
  2. [SOLVED] Formula to calculate number of unique names in column H?
    By Mr.Castle in forum Excel General
    Replies: 5
    Last Post: 09-17-2018, 07:12 PM
  3. [SOLVED] Formula for unique serial number
    By Pulleritz in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-30-2018, 05:08 AM
  4. [SOLVED] Formula to return 0 if number of unique values in a row is greater than 1
    By SurfexcelIT in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-13-2016, 09:40 AM
  5. [SOLVED] I need a formula to filter the details of unique number from another sheet
    By Karthikeyannb in forum Excel General
    Replies: 6
    Last Post: 12-13-2014, 10:38 AM
  6. [SOLVED] Formula to identify a unique number and its most recent date
    By Excel Analyst in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-15-2013, 04:51 PM
  7. [SOLVED] Need a Formula to give a group a unique number
    By rbpd5015 in forum Excel General
    Replies: 7
    Last Post: 05-15-2012, 11:59 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