You can use two indexed arrays to store the count of requests and the existing nodes for each name, and before printing, you can compare the array of existing nodes with your fixed array of nodes, for example:
awk 'BEGIN {
totalNodes=" 36totalNodes="36 54 69 76"
}
NR==1 {print "<Name> <Nodes> <Count of Requests>"};
NR>1 {
count[$1]+=$4; nodesTmp[$1]=nodesTmp[$1]" "$3;
}
END{
for (i in count) {
if(totalNodes!=nodesTmp[i]) {
split(totalNodes,tmp);
for(j in tmp){
if(nodesTmp[i]!~tmp[j]){
nodes[i]=nodes[i]" NA"
}
else {
nodes[i]=nodes[i]" "tmp[j]
}
}
}
else{
nodes[i]=nodesTmp[i]
};
print i, nodes[i], count[i] | "sort"
};
}' temp.log