〜によって/により
By, by means of, due to, depending on (four context-dependent meanings)machine translation
FormationNoun + によって/により; modifying a noun: noun + による + noun
〜によって is a "four-in-one" pattern; you have to rely on context to pick the meaning. Meaning 1 — the AGENT of a passive sentence, especially when saying who created a work or structure: この絵は有名な画家によって描かれた (this painting was painted by a famous artist). Plain に is not used in this type of sentence.
Meaning 2 — MEANS or method, more formal than で: インターネットによって世界の情報が手に入る (thanks to the Internet, information from around the world can be obtained). Meaning 3 — CAUSE: 地震によって家が壊れた (the house was destroyed by the earthquake).
Meaning 4 — DEPENDING ON, paired with words like 違う・変わる・いろいろだ: 国によってあいさつの仕方が違う (greetings differ depending on the country). This is the only meaning where the second clause must talk about difference or change.
Two variants to remember: により is the written form, common in announcements and news reports; による comes before a noun to modify it: 台風による被害 (damage caused by the typhoon). Don't confuse it with によると — that pattern marks an information source, "according to…," and is a separate grammar point.
Examples
この絵は有名な画家によって描かれました。
This painting was painted by a famous artist.
国によって、あいさつの仕方が違います。
Greetings differ from country to country.
地震により、電車が止まっています。
Due to the earthquake, the trains have stopped running.