'mapf' was not declared in this scope

I am a bit of novice with Arduino coding so don’t really know how to fix this error. Any help would be very much appreciated, thanks. I’m using an ADXL377 (and plan on using 3 more together) on an Elegoo MEGA 2560 R3

#include <Arduino.h>
int scale = 200;
boolean micro_is_5v = true;

void setup() {
  // Initialize serial communication at 115200 baud
  Serial.begin(115200);
}

void loop() {
  // Get raw accelerometer data for each axis
  int rawX = analogRead(A0);
  int rawY = analogRead(A1);
  int rawZ = analogRead(A2);

float scaledX, scaledY, scaledZ; // Scaled values for each axis
if (micro_is_5v) // microcontroller runs off 5v
{
  scaledX = mapf(rawX, 0, 675, -scale, scale); //3.3/5 * 1023 =~ 675
}
else() // microcontroller runs off 3.3v
{
  scaledX = mapf(rawX, 0, 1023, -scale, scale);
}

if (micro_is_5v) // microcontroller runs off 5v
{
  scaledY = mapf(rawY, 0, 675, -scale, scale); // 3.3/5 * 1023 =~ 675
}
else // microcontroller runs off 3.3v
{
  scaledY = mapf(rawY, 0, 1023, -scale, scale);
}

if(micro_is_5v) // microcontroller runs off 5v
{
  scaledZ = mapf(rawZ, 0, 675, -scale, scale);
}
else // microcontroller runs off 3.3v 
{
scaledZ = mapf(rawZ, 0, 1023, -scale, scale);
}

// Print out scaled X,Y,Z accelerometer readings
Serial.print("X:Y:Z"); 
Serial.print("X :");
Serial.print(scaledX);
Serial.print("Y :");
Serial.print(scaledY);
Serial.print("Z :");
Serial.print(scaledZ)
}

You are trying to call a function (mapf() that you have not defined. Why do you think you can do that?

The mapf() function is not native to Arduino. However it is available here.

I added the function to the end of your code, formatted the code (Auto Format with ctrl-t or Tools, Auto Format) and fixed a couple of other errors (marked with ********** in the code).

#include <Arduino.h>
int scale = 200;
boolean micro_is_5v = true;

void setup()
{
   // Initialize serial communication at 115200 baud
   Serial.begin(115200);
}

void loop()
{
   // Get raw accelerometer data for each axis
   int rawX = analogRead(A0);
   int rawY = analogRead(A1);
   int rawZ = analogRead(A2);

   float scaledX, scaledY, scaledZ; // Scaled values for each axis
   if (micro_is_5v) // microcontroller runs off 5v
   {
      scaledX = mapf(rawX, 0, 675, -scale, scale); //3.3/5 * 1023 =~ 675
   }
   else // else does not get "()" *************************** // microcontroller runs off 3.3v
   {
      scaledX = mapf(rawX, 0, 1023, -scale, scale);
   }

   if (micro_is_5v) // microcontroller runs off 5v
   {
      scaledY = mapf(rawY, 0, 675, -scale, scale); // 3.3/5 * 1023 =~ 675
   }
   else // microcontroller runs off 3.3v
   {
      scaledY = mapf(rawY, 0, 1023, -scale, scale);
   }

   if (micro_is_5v) // microcontroller runs off 5v
   {
      scaledZ = mapf(rawZ, 0, 675, -scale, scale);
   }
   else // microcontroller runs off 3.3v
   {
      scaledZ = mapf(rawZ, 0, 1023, -scale, scale);
   }

   // Print out scaled X,Y,Z accelerometer readings
   Serial.print("X:Y:Z");
   Serial.print("X :");
   Serial.print(scaledX);
   Serial.print("Y :");
   Serial.print(scaledY);
   Serial.print("Z :");
   Serial.print(scaledZ);  // was missing ; ************************************
}

float mapf(double val, double in_min, double in_max, double out_min, double out_max)
{
   return (val - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}

It is NOT necessary to have 3 if/else statements, when the condition is the same in all three.

   float scaledX, scaledY, scaledZ; // Scaled values for each axis
   if (micro_is_5v)
   {
      scaledX = mapf(rawX, 0, 675, -scale, scale);
      scaledY = mapf(rawY, 0, 675, -scale, scale);
      scaledZ = mapf(rawZ, 0, 675, -scale, scale);
   }
   else
   {
      scaledX = mapf(rawX, 0, 1023, -scale, scale);
      scaledY = mapf(rawY, 0, 1023, -scale, scale);
      scaledZ = mapf(rawZ, 0, 1023, -scale, scale);
   }

Even with this simplification, your premise is wrong. The value returned by analogRead() is a value between 0 and 1023, where 0 means 0V and 1023 means whatever voltage the Arduino is running at. So, the mapping should ALWAYS be 0 to 1023 to -scale to scale.