English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

suppose i have (b,b,c,b,c,a,f,a) in column A and to get (b,c,a,f) in column B. pls instruct step by step using above info in your formulas.

2007-04-26 07:33:30 · 2 answers · asked by firooz 1 in Computers & Internet Programming & Design

2 answers

Basically you have to build a formula to use in every row of column B that
1. look up those cells in 1 row up (if any, cause B1 will has no cell above) and 1 column right (column A)
2. if there is no match, its showing up the 1st time, show the value in column B
3. there's match, show blank.
Say in B1 you put the following formula
=IF(ROW()=1,A1,IF(ISNA(MATCH(A1,$A$1:INDIRECT(ADDRESS(ROW()-1,COLUMN()-1,4)),0)>0),A1,""))
In the above formula,
ADDRESS(ROW()-1,COLUMN()-1,4) will build the address of cell region for checking of possible match with the cell value just underneath the region
INDIRECT(...) will turn the address in text to excel cell address
MATCH(...,0) will return a number >0 if there is a match, no match then "#N/A"
ISNA(...) will return a "TRUE" if there is no match("#N/A"), value is unique
ROW()=1 is to recognise 1st value in cell region for checking is unique, cause there's no cell A0
Note: the number in ROW()=1 AND $A$1 must match to show the start of list of value in column A, if A1:A3 is blank the list start from A4 the two parts in formula should be ROW()=4 AND $A$4.
A demo excel file is here http://www.freewebs.com/swhtam/unique.xls
Hope this helps

2007-04-26 13:05:09 · answer #1 · answered by AQuestionMark 7 · 0 0

Hhmm are you talking about sql?

SELECT DISTINCT(colA) From mytable

Probably not, dont know your language sooo...

t=0;
for (int x=0;x {
boo =0;
for (int s=0;s {
if (colA[x] = colB[s])
boo = 1;
}
if (boo == 0)
ColB[t] = ColA[x];
t++;
}

2007-04-26 07:42:41 · answer #2 · answered by sean_mccully 3 · 0 0

fedest.com, questions and answers