Scottsdale, Arizona - I was walking along the dairy aisle and was struck by how many substitute products there are for milk. I came across at least a dozen varieties. In addition to soy milk, there are nut-based products (almond, cashew, coconut, hazelnut and macadamia milks).

Some substitutes use grains or seeds, such as flax, hemp, oat, rice and quinoa, as their base. There are also blends of various nuts, grains and seeds. I even saw an in-store demonstration of how to make milk from beans, peas and lentils.

Are milk substitutes helpful? How do you know which to choose? Might some be dangerous? The answers depend on the composition of the milk substitute, whether it helps you meet your nutritional needs and if you have an underlying medical condition.

First I'll cover what an average healthy adult should consider. Then I'll offer advice for people with a few common medical conditions — plus an explanation of why an uninformed choice might be dangerous.

Healthy adults

The key nutrients that milk and milk products provide are calcium, vitamin D, phosphorus and, to some extent, potassium. It can be difficult to get adequate amounts of these nutrients from other foods, which is why the Dietary Guidelines for Americans recommend 3 servings a day for most adults.

Some — but not all — milk substitutes are fortified with similar amounts of these nutrients. The Dietary Guidelines mention only soy milk as an equivalent choice.

When looking at milk substitutes, read labels to ensure you choose a substitute that contains similar amounts of calcium (30 percent of the Daily Value) and vitamin D (25 percent of the Daily Value) as milk does.

Lactose intolerance

A person with lactose intolerance is partially or completely unable to digest the natural sugar in cow’s milk (lactose). Approximately 65 percent of the world's population has a reduced ability to digest lactose after infancy.For some people, lactose intolerance develops after an illness, with certain diseases of the small intestine (Crohn's or celiac disease) or after surgery of the bowel.

If you have lactose intolerance, you may be able to tolerate lactose in small amounts spaced throughout the day. If not, you may need to opt for a milk substitute that's fortified with calcium and vitamin D.

Milk allergy

One of the most common food allergies in children, milk allergy is caused when the immune system triggers a response to the proteins casein and whey in cow's milk. Sheep, goat and buffalo milk may also trigger a reaction.

Avoiding cow's milk (and possibly other animal milk) and products that contain it is the primary treatment. Although you might think that any plant-based milk substitute would be safe, it's important to know that about 30 percent of food-allergic children have multiple food allergies.

Allergies to tree nuts (including but not limited to walnut, almond, hazelnut, cashew, pistachio and Brazil nuts), peanuts and soy are common. Many milk substitutes are made from these common allergens. So it's essential to seek advice from an allergist or dietitian.

Chronic kidney disease

According to the Centers for Disease Control and Prevention, one in 10 adults has chronic kidney disease (CKD). CKD causes gradual loss of kidney function, which results in the build-up in the body of fluid, electrolytes (sodium, potassium, calcium, phosphate) and waste (nitrogen from protein). Regulating electrolytes, especially potassium, is critical for maintaining a normal heart rhythm. Kidney failure also upsets vitamin D metabolism and the balance of calcium and phosphorus. This results in bone loss, increased levels of calcium and phosphorus in the blood, and deposits in the joints, heart and lungs.

Dietary restrictions are often placed on protein, phosphorus, sodium and potassium. Vitamin D and calcium must be monitored too. Because milk substitutes contain these nutrients, an uninformed choice could be dangerous. Fortunately when people are diagnosed with CKD, they get routinely screened and should be referred for expert dietary advice.

Cancer

The evidence about the role of dairy products and various cancers is mixed. Milk from cows may lower the risk of colorectal and bladder cancer, and it doesn't seems to be associated with breast or ovarian cancer. However, there is limited evidence that milk — and diets high in calcium — may increase the risk of prostate cancer.

Similarly, the effects of soy milk on cancer risk aren't clear. However, moderate consumption of soy foods (not supplements) appears safe for breast cancer survivors and may lower breast cancer risk in the general population.

The bottom line: If you have a medical condition, talk with your doctor or dietitian before trying a milk substitute. Don't risk your health by making an uninformed choice.