We continue the study in [15, 18] on the upper Lyapunov exponents for products of matrices. Here we consider general matrices. In general, the variational formula about Lyapunov exponents we obtained in part I does not hold in this setting. In any case, we focus our interest on a special case where the matrix function M(x) takes finite values M1, ..., Mm. In this case, we prove the variational formula under an additional irreducibility condition. This extends a previous result of the author and Lau [18]. As an application, we prove a new multifractal formalism for a certain class of self-similar measures on ℝ with overlaps. More precisely, let μ be the self-similar measure on ℝ generated by a family of contractive similitudes {Sj = ρx + bj}j=1ℓ which satisfies the finite type condition. Then we can construct a family (finite or countably infinite) of closed intervals {Ij}j∈Λ with disjoint interiors, such that μ is supported on ⋃j∈ΛIj and the restricted measure \documentclass[12pt]{minimal}
\usepackage{amsmath}
\usepackage{wasysym}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage{mathrsfs}
\usepackage{upgreek}
\setlength{\oddsidemargin}{-69pt}
\begin{document}$$
\mu |_{I_j }
$$\end{document} of μ on each interval Ij satisfies the complete multifractal formalism. Moreover, the dimension spectrum dimH\documentclass[12pt]{minimal}
\usepackage{amsmath}
\usepackage{wasysym}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage{mathrsfs}
\usepackage{upgreek}
\setlength{\oddsidemargin}{-69pt}
\begin{document}$$
E_{\mu |_{I_j } }
$$\end{document} (α) is independent of j.