+ Reply to Thread
Results 1 to 6 of 6

help with duplicates and IF formulas

  1. #1
    Registered User
    Join Date
    05-26-2014
    Location
    Denmark
    MS-Off Ver
    Office 16
    Posts
    44

    help with duplicates and IF formulas

    Hi,

    I hope you can help me.

    I have a sheet of several thousand rows. Here I have OrderIDs on sales. What I need is this:

    if OrderID has only Product 1 then output should be 6. if OrderID has Product 1 and 2 then output should be 1. I will need the yellow cells to be filled out.

    The orderIDs migt not neccesarily be together in the file. Meaning a OrderID A that has both product 1 and 2 might have one row for product 1 in row 10 and product 2 row will be row 100000.

    I attached a small file which I hope you can help with.

    thanks!
    br, Alexander
    Attached Files Attached Files

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: help with duplicates and IF formulas

    something like this?
    =IF(COUNTIF($D$2:$D$17,D2)>1,6,1)

    or to check if in B column doesn't exist any other value but 1 or 2 only
    =IF(OR(B2=1,B2=2),IF(COUNTIF($D$2:$D$17,D2)>1,6,1))
    Last edited by sandy666; 05-21-2017 at 05:46 PM.

  3. #3
    Registered User
    Join Date
    05-26-2014
    Location
    Denmark
    MS-Off Ver
    Office 16
    Posts
    44

    Re: help with duplicates and IF formulas

    perhaps. If there are more than one Order ID 32100087708125 then it says 6. However, there will be cases where sometimes there will be more than 1 of the same order ID but with the same productgroup, e.g. A. Then it should say 1.

    IF(COUNTIF($D$2:$D$17,D2)>1,6,1)

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: help with duplicates and IF formulas

    so
    if
    B2=1,C2=A,D2=single result=?
    B2=1,C2=B,D2=single result=?
    B2=1,C2=A,D2=dup result=?
    B2=1,C2=B,D2=dup result=?
    the same for B2=2 etc

    attach example with all possibilities
    Last edited by sandy666; 05-22-2017 at 04:11 AM.

  5. #5
    Registered User
    Join Date
    05-26-2014
    Location
    Denmark
    MS-Off Ver
    Office 16
    Posts
    44

    Re: help with duplicates and IF formulas

    it's tricky to explain.

    Imagine sales where one can buy a mobil subscription and an iPhone. If your orderID has 2 duplicated this may indicate one row for the subscription and one for the handset. however, in some cases there might be sold 2 subscriptions and no iPhones in the same orderID.
    if there is only one row its a subscribtion only. See attached.

    thanks!
    Attached Files Attached Files

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: help with duplicates and IF formulas

    I asked for example with atypical cases. second example is the same as first, except you changed 1 and 2 to handset and subs and deleted A,B. so this formula works (with second example also)
    =IF(COUNTIF($C$2:$C$17,C2)>1,6,1)

+ 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 VBA formulas - duplicates, pop-up box
    By fexigo in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-07-2015, 04:55 AM
  2. [SOLVED] Remove Blanks & Duplicates using only formulas
    By johnhe in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-30-2015, 12:18 PM
  3. Eliminate Duplicates In Rank Formulas
    By nevi in forum Excel General
    Replies: 10
    Last Post: 09-24-2014, 01:48 PM
  4. Fix formulas so there are no duplicates
    By smani125 in forum Excel General
    Replies: 6
    Last Post: 01-20-2012, 09:38 PM
  5. Eliminate Duplicates In Rank Formulas
    By nevi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-23-2010, 10:06 PM
  6. Duplicates and Replacement Formulas
    By Narianna in forum Excel General
    Replies: 7
    Last Post: 02-16-2006, 01:45 PM
  7. [SOLVED] Formulas for telephone numbers: finding duplicates, autoformat
    By Sandeep Elbak in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-04-2005, 03:06 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