I've had similar experiences.

At the end of 10 hour hard-labor days while remodeling my house and redoing my foundation I would feel terrible and have a head ache. Then I started drinking Gatorade. Everything changed and I felt much better.

The day before a week long backback trip I was reviewing my food and realized I had almost no salt in any of the food. My peanuts, for example, were saltless. I quickly made some changes.