Vlookup in Excel returns False or 0 when executing

5 views
Skip to first unread message

Darren

unread,
Oct 14, 2009, 10:34:07 AM10/14/09
to Spreadsheet::WriteExcel
Hi,

I am in the process of self teaching myself Perl and in particular
WriteExcel. I have designed a whole workbook but when I come to
approach doing the Vlookup I hit a snag!

$formula = q{=IF(VLOOKUP(C3,Data Rev!A:B,2,0))};
$formula = $excel_sheet1->store_formula($formula);
@$iferror = map {s/_ref2d/_ref2dV/;$_} @$iferror;


The Vlookup above works when typed into excel but when I input this
into the perl script it returns the 0. If i click on enter in the
excel spreadsheet, it executes the vlookup.

Any ideas on what I am doing wrong, I have found additional
information that attaches itself to the Vlookup but if I am being
honest I have no idea what the final line means at all.

for my $row (1..5) {
$excel_sheet1->repeat_formula($row, 5, $formula, $formatop, 'F3',
'F'.($row +1));

(qr/^C3$/, 'F' . ($row +1));
}

Any help would be most appreciated.

Thanks

Darren

Calvin

unread,
Oct 14, 2009, 12:41:27 PM10/14/09
to Spreadsheet::WriteExcel
Excel would have done some munging to that after you typed it. There
will need to be some single quotes to get the spaces in the sheet name
to parse correctly. Closely examine what Excel has for that formula,
paying close attention to the '.

Darren

unread,
Oct 16, 2009, 5:12:27 AM10/16/09
to Spreadsheet::WriteExcel
Thanks Calvin,

I have sorted it now. Thank you for your help!
> > Darren- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages