# Using Raster Calculator in ArcMap

I am using ArcMap 10.3.

I am trying to create a new raster from 12 pre-existing rasters using the Raster calculator and I am having some trouble. You see, I want to create a new raster that represents the Precipitation Concentration Index, which uses the following formula:

``````PCI = (Summation (p^2) / (Summation (p)^2)) * 100;
where p = monthly precipitatoin average
``````

I have all the rasters for world precipitation means by month, and hence I am using the following formula on Raster Calculator:

`((("prec_1" ^ 2) + ("prec_2" ^ 2) + ("prec_3" ^ 2) + ("prec_4" ^ 2) + ("prec_5" ^ 2) + ("prec_6" ^ 2) + ("prec_7" ^ 2) + ("prec_8" ^ 2) + ("prec_9" ^ 2) + ("prec_10" ^ 2) + ("prec_11" ^ 2) + ("prec_12" ^ 2)) / (("prec_1" + "prec_2" + "prec_3" + "prec_4" + "prec_5" + "prec_6" + "prec_7" + "prec_8" + "prec_9" + "prec_10" + "prec_11" + "prec_12") ^ 2)) * 100`

As a result, I was expecting something like this:

I have tried changing the symbology of the raster layer to "Streched" and adjusting the values to a suitable scale (they range between 0 and 50) following the example of the monthly precipitation layers - but then the map is just blank.

Anyway, since I do not know much about coding, I was hoping someone could help doing this the simplest way possible.

This is the exact message I got from ArcMap:

``````Messages
Executing: RasterCalculator "((("prec_1" ^ 2) + ("prec_2" ^ 2) + ("prec_3" ^ 2) + ("prec_4" ^ 2) + ("prec_5" ^ 2) + ("prec_6" ^ 2) + ("prec_7" ^ 2) + ("prec_8" ^ 2) + ("prec_9" ^ 2) + ("prec_10" ^ 2) + ("prec_11" ^ 2) + ("prec_12" ^ 2)) / (("prec_1" + "prec_2" + "prec_3" + "prec_4" + "prec_5" + "prec_6" + "prec_7" + "prec_8" + "prec_9" + "prec_10" + "prec_11" + "prec_12") ^ 2)) * 100" C:\Users\Documents\ArcGIS\Default.gdb\rastercalc
Start Time: Tue Feb 11 10:56:15 2020
(((Raster(r"prec_1") ^ 2) + (Raster(r"prec_2") ^ 2) + (Raster(r"prec_3") ^ 2) + (Raster(r"prec_4") ^ 2) + (Raster(r"prec_5") ^ 2) + (Raster(r"prec_6") ^ 2) + (Raster(r"prec_7") ^ 2) + (Raster(r"prec_8") ^ 2) + (Raster(r"prec_9") ^ 2) + (Raster(r"prec_10") ^ 2) + (Raster(r"prec_11") ^ 2) + (Raster(r"prec_12") ^ 2)) / ((Raster(r"prec_1") + Raster(r"prec_2") + Raster(r"prec_3") + Raster(r"prec_4") + Raster(r"prec_5") + Raster(r"prec_6") + Raster(r"prec_7") + Raster(r"prec_8") + Raster(r"prec_9") + Raster(r"prec_10") + Raster(r"prec_11") + Raster(r"prec_12")) ^ 2)) * 100
Succeeded at Tue Feb 11 11:03:31 2020 (Elapsed Time: 7 minutes 16 seconds)
``````

in the raster calculator, the symbol "^" is a boolean operator, not the power function.

For the square values, you should either use the Power() function or the equivalent operator **

``````"prec_1" ** 2

Power("prec_1",2)
``````

In addition, make sure that you work in float, before your percentages could be rounded to zero before you multiply by 100.

Another issue could be the presence of NoData in some files, which would result in NoData values everywhere.

• I am running this as I write. I will let you know as I see the results. Anyway, I was wondering if the NoData problem could be solved by the fact that the precipitation layers state that NoData Value is equal to -32768 – ArchaeoRG Feb 11 at 11:38
• Thank you so much! This fixed it! – ArchaeoRG Feb 11 at 12:16