How to get the earlist date based upon column A

earlist date.xlsx (10.8 KB)
in excel i have A, B column, A column contains some groups and some group names are the same, B column with different dates. How could i get one datatable which ocntains only non duplicate groups and with its earlist dates from column B?
thank you very much
mz

i would like to get the attached datatable thanks. mz
earlist date result.xlsx (10.7 KB)

@mingzi.dugu

Check the xaml attached
earliest date.xaml (6.0 KB)

Hello Varun
i am so happy to see the xmal file. it got the needed result, which i have failed many times. i ll then check my original file to have a try. i am not sure if i can succeed, because the outDT formula looks a little complicated for me. if i failed, i hope i can still seek your support!
Appreciate your help very much! wish you a nice weekend!
Mz

Uploading: earlist date.xlsx…
Hello Varun
i have tried it but i failed because my working file is with more column. and i am not sure about the formular of below:
(From row In inputDT
Group By id = row(0)
Into grp = Group
Let md = grp.Min(Function (d) d(1))
Select outDT.Rows.Add({id, CDate(md.ToString).ToString(“dd-MM-yyyy”)})).CopyToDataTable

what does “md” stands for? and also function(d) d(1)?
I have uploaded 1 new file with more column in sheet 1, and i expect result is in sheet2. if possible, pls help to check how to realize it.
earlist date.xlsx (12.6 KB)

thank you very much for your support in advance!
regards,
mz

Hi @mingzi.dugu

Check the update xaml file
earliest date.xaml (9.0 KB)

Hello Varun
i am so happy to receive the updated xmal, it is so cool!!
i understood now this is Linq query, which is so awesome and amazing!
i also saw some helped cases you have granted to other users! it is miracle.
thank you and thank you very much for your quick help! this has solved the terrible issues i am facing!
have a nice day!
Mingzi

Thanks @mingzi.dugu for your kind words.
Please mark the solution to close the topic.

And if you want to Learn LINQ please refer this post by @ppr the LINQ Expert

Hello Varun
thank you very much for the infor about Linq. i ll check it though i donot have any programming knowledge.
thank you very much again for the quick help.
Mz

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.