1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use strict;
use Excel::Writer::XLSX;
# Hier wird das Excel Dokument geöffnet
my $workbook = Excel::Writer::XLSX->new( 'Port.xlsx' );
my $worksheet = $workbook->add_worksheet( 'Port_Übersicht' );
# Tabelle mit Inhalt füllen
$worksheet->write( "B5", "Port");
$worksheet->write( "C5", "Status");
$worksheet->write( "B6", "1");
$worksheet->write( "C6", "Up");
$worksheet->write( "B7", "3");
$worksheet->write( "C7", "Up");
$worksheet->write( "B8", "4");
$worksheet->write( "C8", "Up");
$worksheet->write( "B9", "5");
$worksheet->write( "C9", "Down");
$worksheet->write( "E5", "Up-Ports");
$worksheet->write( "E6", "Down-Ports");
# Formeln mit Variable hinzufügen
my $Anzahl_Eintraege = 4;
my $Zellenende = $Anzahl_Eintraege + 5;
my $Ende = "C$Zellenende";
my $UP_Formel = "'=COUNTIF(C6:$Ende,\"Up\")'";
$worksheet->write_formula('F5',($UP_Formel));
# Formel ohne Variable
$worksheet->write_formula('F6', '=COUNTIF(C6:C9,"Down")');
$workbook->close;
exit;
2019-02-21T11:49:46 numerobisCode: (dl )my $UP_Formel = "'=COUNTIF(C6:$Ende,\"Up\")'";
my $UP_Formel = "=COUNTIF(C6:$Ende,\"Up\")";
my $UP_Formel = qq{=COUNTIF(C6:$Ende,"Up")};