48 were purchased (new) of which only 12 were returned to NZ with the RNZAF at the end of the war. Some of the 36 remainder going to the USAF.
First of all, none went to the USAF as that force didn't exist at the time and didn't come into being till the 18th of September 1947, whereas No. 31 Squadron came home in July 1944.
I want to point out that not all the Avengers went up to the Pacific war zone from NZ. The first six aircraft were the oddball TBF-1's so remained in NZ just for training and local partols (just like the first six and last four Hudsons).
When No. 30 Squadron went north they initially took 18 aircraft. After that a handful joined them up there as replacements in a replacement pool at Santo.
When No. 31 Squadron arrived in the war zone they relieved No. 30 Squadron and they took over the No. 30 SU aircraft and the pool. They flew an extra six of their own Avengers from Gisborne to join the SU there (the 31 Sqn aircraft were all owned by 30 SU, a Flight of which had remained at Gisborne). So the numbers of aircraft in the Pacific was probably around the 20-25 mark on any given day (remembering some would return to NZ for heavier maintenance, and some were written off). That left a still healthy pool of aircraft back in NZ, many of which never went to the Pacific.
When No. 31 Sqn's tour ended in July 1944most of 30 SU were sidled off to join No. 2 SU. However some must have remained with some of the Avengers at Santo up till October 1944. At that point several aircraft in the pool were handed to the US Navy. Other Avengers had been flown home by this time.
At the end of the war some of the Avengers still in NZ were handed to the Royal Navy, who placed them on a carrier, took them out to sea and tipped them off into the ocean. Don't forget too that of the 48 aircraft ten were lost in both action and training in the Pacific and in NZ during the war.
To break down which aircraft went to the Pacific and which returned, and which crashed, here's a list:
Remained in NZ through war(and survived war)NZ2501 - sold Larsen 1948
NZ2502 - sold Larsen 1948
NZ2503 - crashed 1956 towing target
NZ2504 - in RNZAF Museum
NZ2505 - at Gisborne with 30 Sqn and SU Assoc
NZ2506 - crashed 1949 topdressing
NZ2526 - sold Larsen 1948 - doesn't seem to have gone to Pacific
NZ2535 - to RN FAA - 7 Sep 1945 - not known to serve overseas
NZ2536 - sold Larsen 1948 - not known to serve overseas
NZ2547 - to RN FAA - 7 Sep 1945 - not known to serve overseas
Aircraft that never left NZ, crashing before Pacific tourNZ2516 - crashed Gisborne 21 Dec 1943 - 30 Sqn
NZ2533 - crashed Ohakea 7 Dec 1944 - 31 Sqn
NZ2548 - crash landed ito sea off Gisborne - 31 Sqn - 15 Mar 44
To Pacific with No. 30 Squadron, most continuing service with 31 SqnNZ2507 - crashed Pacific - 30 Sqn - 26 April 1944
NZ2508 - to US Navy at Santo - 21 Oct 1944
NZ2509 - returned NZ, to RN FAA 7 Sept 1945, scuttled
NZ2510 - returned NZ, to RN FAA 7 Sept 1945, scuttled
NZ2511 - returned NZ, to RN FAA 7 Sept 1945, scuttled
NZ2512 - crashed Pacific - 30 Sqn - 1 July 1944
NZ2513 - to US Navy at Santo - 30 Oct 1944
NZ2514 - returned NZ, to RN FAA 7 Sept 1945, scuttled
NZ2415 - crashed Pacific - 30 Sqn - 24 Jan 1944
NZ2517 - returned NZ, to RN FAA 7 Sept 1945, scuttled
NZ2518 - went Pacific with 30 Sqn, to 31 Sqn, crashed 5/6/44
NZ2519 - sold Larsen 1948
NZ2520 - to US Navy at Santo - 28 Oct 1944
NZ2521 - went Pacific with 30 Sqn, to 31 Sqn, crashed 31/5/44
NZ2522 - returned NZ, to RN FAA 7 Sept 1945, scuttled
NZ2523 - returned NZ, to RN FAA 7 Sept 1945, scuttled
NZ2524 - to US Navy at Santo - 21 Oct 1944
NZ2525 - to US Navy at Santo - 30 Oct 1944
Avengers that didn't go to Pacific with initial 30 Sqn echelon but were either the six re-inforcements No. 31 Squadron took or replacements that went up individuallyNZ2528 - to US Navy at Santo 30 Oct 1944
NZ2529 - to US Navy at Santo - 30 Oct 1944
NZ2530 - crashed Pacific - 31 Sqn - 28 May 1944
NZ2531 - to US Navy at Santo - 30 Oct 1944
NZ2532 - to US Navy at Santo - 21 Oct 1944
NZ2534 - to US Navy at Santo - 21 Oct 1944
NZ2537 - to US Navy at Santo - 21 Oct 1944
NZ2539 - to US Navy at Santo - 21 Oct 1944
NZ2540 - to US Navy at Santo - 21 Oct 1944
NZ2541 - replacement in 30 Sqn Reserve Pool, then active, shot down 10/5/44
NZ2542 - replacement in 30 Sqn Reserve Pool, to NZ, sold Larsen
NZ2543 - to US Navy at Santo - 30 Oct 1944
NZ2544 - 31 Sqn aircraft, shot down 28 May 1944
NZ2545 - to US Navy at Santo - 30 Oct 1944
NZ2546 - to US Navy at Santo - 30 Oct 1944
Avengers that went to Nausori, Fiji to serve as target tugNZ2527 - spent its war Fiji, now at MOTAT
NZ2539 - Fiji Comms Flight, now with Ken Jacobs
So to summarise the above info - if the info I have is right - this shows that 13 aircraft seemingly never left NZ. Two only served in Fiji, both returned and both exist now, amazingly. The rest served at Santo and Piva at some stage, 18 of which went in the initial No. 30 Squadron move north. Many of these returned to NZ and were replaced by replacements from the pool and when No. 31 Sqn took six aircraft north on their move.
In the end 10 had been destroyed in wartime, 16 were handed to the US Navy at Santo, and nine were handed to the RN FAA and dropped off a carrier. The rest (13?) seem to have survived the war to continue to serve and/or be stored in the postwar RNZAF, some being sold for scrap in 1948 and two crashing postwar. I hope I have my sums right here. It's late.