In Excel for d20 I use the formula: =RAND()*(20-1)+1
and substitute 4, 6, 8 etc. for the other dice.
For maps I use The Gimp. Here's a cut-paste about my technique from another post.
There's a free photo-editing program (similar to Photoshop) called the GIMP (Gnu Image Mapipulation Program) that I've found to be very useful for mapping. Here's what I do:
1. I learned to make custom brushes and patterns from a tutorial and made a one inch square. I saved the square as a pattern. Then used the bucket-fill feature to fill a white 8x11 or 8x13 background with it to get my starting sheet with gridlines.
2. Then add another layer of white to obscure the 1-inch grid sheet completely. Then use the Eraser tool to un-obsure the relevant gridlines on the map. It's like the old school art project where you'd heavily color a picture with black crayon and scrape it off in a pattern to reveal the masterpiece underneath.
3. Then add a transparent layer and name it terrain. This is where I draw contour lines for hills or draw pits, boulders, or immovable wreckage. You could also make a cobblestone brush for roads in civilized areas, or a pillar brush, or whatever. I design my brushes to fit into a 1 inch square for precision, but you could make them as large as you want if you dislike clicking a lot to paint a sheet.
4. Then add another transparent layer and name it foliage. I've made custom brushes for jungles and coniferous forests. You could also add a little number on the terrain and foliage brushes to indicate that jungle slows movement by 25%, or trackless jungle by 75% etc.
The amount of layers you can add is limited only by your RAM, but I've not needed more than 5 per map and this old PC handles that just fine.