vlookupcumulative-sumlibreoffice-calc

LibreOffice Calc #N/A preventing summing after vlookup data is processed


How to get rid of the #N/A in G5? I know it's because there's no name in E5 for the vlookup function to produce a result, but I don't want to have to type every single employee in column E and then manually write in 0 hours. enter image description here

Cell G4 says (works)...

=F4*VLOOKUP(E4,$Sheet1.$B$4:$Sheet1.$C$6,2,0)

and of course G5 (doesn't work as mentioned above) says...

=F5*VLOOKUP(E5,$Sheet1.$B$4:$Sheet1.$C$6,2,0)

The #N/A in G5 prevents the sum formula in G7 working. G7 says.... =SUM(G4:G6)

In G5 I've tried things like:

=if(or(e5="",f5=""),(F6*VLOOKUP(E6,$Sheet1.$B$4:$Sheet1.$C$6,2,0)),"")

But LO Calc Gives an Err:504

p.s. I know 'lookup' can be used here in this extract, but vlookup is being used in the actual master spreadsheet and I want to stick with that method


Solution

  • JohnSUN's comment answered my question. For me, it didn't require any explanation.

    Solve the issue by pasting the IF variant in the cell where #N/A appeared....

    =IFERROR(F4*VLOOKUP(E4;$Sheet1.$B$4:$Sheet1.$C$6;2;0);"")