Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
=IF(ISERROR(MODE(D4:M4)),"",MODE(D4:M4))


What I have tried:

i do not know how do the code for it
Posted
Updated 30-Mar-19 2:02am

1 solution

The basic SQL query for what you want to do can be done using aggregation
SQL
SELECT TOP 1 Column_Name
FROM   Table_name
GROUP  BY [Column_Name]
ORDER  BY COUNT(*) DESC


Now it appears that the values that you want to do this on in your Excel worksheet are in rows and not columns. You would need to do an UNPIVOT query on the row first and then do the above query on that.
Using PIVOT and UNPIVOT - SQL Server | Microsoft Docs[^]
 
Share this answer
 
Comments
Maciej Los 31-Mar-19 5:03am    
5ed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900