It just occurred to me that it is very easy to explain using Spanish: I would use "sveiki" or "labdien" (literally 'good day') when greeting a person I would address as "Ud." (a doctor, a professor, a salesperson etc.) and "čau" for people I address as "tú" (my family, friends, acquaintances not much older than me etc.). The only remaining hurdle is that Latvians seem to be more reserved and shy about using "tú" than Spanish-speaking people (according to my limited experience).
Interestingly, there is a pair of greetings that are less familiar than "čau", but not as formal as "sveiki": these are "sveiks"/"sveika" used to greet a male/a female respectively (note: not two people, but a single person, as these are essentially adjectives that have assumed a new function; the ending depends on the sex of the person, as well as the number of people). These, too, are basically for people you'd address as "tú".
Hi, a great comment about the theme by Sillu, I can verify that it's completely truth, as I'm Latvian that knows Spanish very well.
About saying "Čau" for "bye", it's not so common as to use "Čau" for "hi"! Normally for "bye" we use "atā".
But "Sveiks" and "Sveika" are also very good forms to say "hello" to friends. They are not official forms, such as "Sveiki".