0

I need help for distinct count for duplicate value and output required as follows.

If Column A's value is 28 the result should be unique1(Column E) Else if Column A's value is 29 then the result should be Column F(Unique2)

Code    Product     Quantity    Weight  Unique1 Unique2
28      Apple       9           100     1       0
28      Orange      9           100     1       0
28      Apple       9           100     0       0
29      Apple       9           200     0       1
29      Apple       10          100     0       1
29      Apple       10          100     0       0
28      Orange      9           200     1       0

I tried Mr.tigeravatar code and it is working fine, but I don't know how to add an if ... else condition for checking and output in a different column.

BryanH
  • 5,826
  • 3
  • 34
  • 47
  • Should be easy enough - `IF(Column A=28,Column E, IF(Column A=29, Column F, Col To Return if Neither))` or you could use `CHOOSE(Column A - 27, Column E, Column F)` – Darren Bartrup-Cook Oct 09 '17 at 16:22
  • re: *'I tried Mr.tigeravatar code'* Cool. Which code is that? –  Oct 09 '17 at 16:51
  • Sorry Sir I am unable to post the full code due limitation. But I search in google and search result link is https://stackoverflow.com/questions/32125625/unique-count-formula-for-large-dataset and tigeravatar code is found – user2579235 Oct 09 '17 at 17:39

1 Answers1

0

For validation try this code: paste it in cell G2 or whatever preceding columns in row 2.

=IF(OR(AND(A2=28,E2=1,F2<>1),AND(A2=29,E2<>1,F2=1)),"Correct","Incorrect")
Sachi
  • 1,286
  • 1
  • 10
  • 17