Which formula is correct for a Digital-Analog-Converter?
This is the classic 'fencepost problem'. \$2^N\$ is the number of codes, and \$2^N-1\$ is the number of steps between codes. Since the MSB transition is defined as \$V_{ref}/{2}\$, the full-scale code falls just one step short of \$V_{ref}\$.

edit:

Here's an example, taken from the MAX541 datasheet (full disclosure: I am an applications engineer at Maxim Integrated):
https://datasheets.maximintegrated.com/en/ds/MAX541-MAX542.pdf



Note the full-scale value for analog output is 65535/65536 of VREF, or 32767/32768 of VREF, depending on configuration.