I have never ever had this problem so I am at a complete loss…
I made a gauge swatch for a sweater the gauge is 18st/24rows =4" using size 8 needles. I did my swatch and not quite 4 inches across and 4.5 inches over 24 rows. I know if I go down a needle size my width would also go down too much but if I go up my length would be even more off. What should I do?
You may have to change your choice of yarn.
When you do a gauge swatch, you should try to make it larger than 4 inches so you can measure stitches that don’t include the edges. In this case, casting on, say, 25 stitches would allow you to measure the stitches over 4 inches rather than trying to make a swatch 4 inches wide.
That said, stitch gauge is always more important than row gauge. Most patterns have you knit X number of inches, anyway. If a pattern gives you the number of rows to do, you can do a little math to make sure your length is correct.
You can’t however, make something wider.