it sounds like a problem with a region of traces on the keyboard, which could point to liquid or other corrosion or physical damage, like wearing out. Keyboards can be expensive to replace, but are easy to install and a lot less than a new computer.
one thing that might work is to remove the keyboard completely (check manual or other pages for help doing this). If something sticky like milk, soda, juice got in it, this would need to be cleaned. And as there are no electronically charged parts in the keyboard, you can run it under water or even throw it in the dishwasher (theoretically). The only problem is that you will need to DRY it COMPLETELY, which would be several hours with a fan on it or several days out on the line (a great image). A good way to accelerate the process is to use isopropyl alcohol, which will displace the water and accelerate drying and reduce/eliminate corrosion from trapped water.
It might also be as simple as a bad connection to the motherboard, so start by removing and then reinstalling the keyboard, but if you know something has been spilled on it, take it off and clean it, either by submersion or by removing keys and wiping (with alcohol) anything you can get to.
so I'd try
1) check connection
2) clean by removing some keys
3) clean by submersion and alcohol and DRYING.