Before factory reset, try some of these. Make a speakerphone call after each step. Before you start, backup your documents, photos, and such to the cloud or PC.
1. Check the microphone hole to see if it's blocked. Blow it out with some compressed air. I've read of people using a paperclip to clear it, but I'd avoid that.
2. Turn off your bluetooth. You want to isolate the issue to just what is built into the device. Reboot and try the call.
3. Boot the phone into SAFE MODE. That will further isolate the issue to only the apps and functions that came preinstalled on your device. This doesn't delete anything. If the speakerphone works, your issue is an app.
4. If your issue is an app. then you can try first to reset your phone to factory default settings. This is different from the Factory Data Reset (FDR), and will not delete any apps or data, but will reset any customization. Use this to isolate your issue to a setting being out of position or something being turned on (or off) that shouldn't be.
If none of this clears your issue, then consider a FDR. This will wipe your device and make it like it just came from the box. If your issue remains, and you determine that it's hardware-related, you'll have to the FDR anyway when you replace the device. Verizon replaced one of my wife's Note 4 devices (she's gone through several) for a bad mic.
Good luck.