15 Messages
Digest #4772
Messages
Sun May 26, 2019 12:03 am (PDT) . Posted by:
"hendrik karnadi" hendrikkarnadi
Kayaknya sih memang masalah pembulatan Mr.Kid.
Yang membuat saya penasaran, mengapa hanya terjadi pada 2 baris itu saja.
Salam,
HK
Sent from Yahoo Mail on Android
On Sun, May 26, 2019 at 4:34, 'Mr. Kid' mr.nmkid@gmail.com [belajar-excel]<belajar-excel@yahoogroups.com> wrote:
Mungkin karena round
Sent from my smart enough phone
On May 25, 2019, at 20:48, hendrik karnadi hendrikkarnadi@yahoo.com [belajar-excel] <belajar-excel@yahoogroups.com> wrote:
Dear Be-Excel,
Untuk mengisi waktu luang di malam minggu, saya mencoba me-lihat2 kembali warisan Alm. Mbak Siti (Senior kita).Di situ saya menemukan UDF untuk menghitung Penghasilan Kena Pajak, yang secara aturan dibulatkan kebawah (dalam ribuan).
Dalam Worksheet terlampir (saya revisi hanya untuk th 2009), beliau memperbandingkan hasil perhitungan UDF dengan Formula.
UDF nya adalah sebagai berikut:Option Explicit
Function fPPh21_2009(PhKP As Currency) As Currency Dim LapisPh() As Currency Dim Tarif() As Double 'mbak Siti pakai Single, saya ganti Double Dim n As Integer, Lps, Trf Dim pajak As Currency Lps = Split("|50|250|500", "|") ReDim LapisPh(1 To UBound(Lps)) For n = 1 To UBound(Lps): LapisPh(n) = Round((CLng(Lps(n)) * 10 ^ 6), 0): Next n Trf = Split("/5/15/25/30", "/") ReDim Tarif(1 To UBound(Trf)) For n = 1 To UBound(Trf): Tarif(n) = Round((CDbl(Trf(n)) / 100), 2): Next n 'Sng saya ganti Dbl PhKP = 1000 * Round(PhKP / 1000, 0) Select Case PhKP Case Is <= LapisPh(1) pajak = PhKP * Tarif(1) Case Is <= LapisPh(2) pajak = LapisPh(1) * Tarif(1) _ + (PhKP - LapisPh(1)) * Tarif(2) Case Is <= LapisPh(3) pajak = LapisPh(1) * Tarif(1) _ + (LapisPh(2) - LapisPh(1)) * Tarif(2) _ + (PhKP - LapisPh(2)) * Tarif(3) Case Is > LapisPh(3) pajak = (LapisPh(1)) * Tarif(1) _ + (LapisPh(2) - LapisPh(1)) * Tarif(2) _ + (LapisPh(3) - LapisPh(2)) * Tarif(3) _ + (PhKP - LapisPh(3)) * Tarif(4) End Select fPPh21_2009 = Round(pajak)End Function
Formula pada baris 12 dan 13 adalah sbb:=IF(C12<=0,0,IF(C12<=50000000,5%*C12,IF(C12<=250000000,50000000*5%+(C12-50000000)*15%,IF(C12<=500000000,50000000*5%+200000000*15%+(C12-250000000)*25%,50000000*5%+200000000*15%+250000000*25%+(C12-500000000)*30%))))
=IF(C13<=0,0,IF(C13<=50000000,5%*C13,IF(C13<=250000000,50000000*5%+(C13-50000000)*15%,IF(C13<=500000000,50000000*5%+200000000*15%+(C13-250000000)*25%,50000000*5%+200000000*15%+250000000*25%+(C13-500000000)*30%))))
Hasilnya seharusnya sama tapi berbeda beberapa ratus rupiah hanya pada kedua baris ini.
Pertanyaan saya (bukan ngetes):Apa yang menyebabkan terjadinya perbedaan tsb ?
Untuk lebih jelasnya saya lampirkan workbooknya.
Terima kasih.
Salam,HK
<UDF_fPPh21 (Rev by HK - Single to Double).xls>
#yiv8206055941 #yiv8206055941 -- #yiv8206055941ygrp-mkp {border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv8206055941 #yiv8206055941ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv8206055941 #yiv8206055941ygrp-mkp #yiv8206055941hd {color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}#yiv8206055941 #yiv8206055941ygrp-mkp #yiv8206055941ads {margin-bottom:10px;}#yiv8206055941 #yiv8206055941ygrp-mkp .yiv8206055941ad {padding:0 0;}#yiv8206055941 #yiv8206055941ygrp-mkp .yiv8206055941ad p {margin:0;}#yiv8206055941 #yiv8206055941ygrp-mkp .yiv8206055941ad a {color:#0000ff;text-decoration:none;}#yiv8206055941 #yiv8206055941ygrp-sponsor #yiv8206055941ygrp-lc {font-family:Arial;}#yiv8206055941 #yiv8206055941ygrp-sponsor #yiv8206055941ygrp-lc #yiv8206055941hd {margin:10px 0px;font-weight:700;font-size:78%;line-height:122%;}#yiv8206055941 #yiv8206055941ygrp-sponsor #yiv8206055941ygrp-lc .yiv8206055941ad {margin-bottom:10px;padding:0 0;}#yiv8206055941 #yiv8206055941actions {font-family:Verdana;font-size:11px;padding:10px 0;}#yiv8206055941 #yiv8206055941activity {background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv8206055941 #yiv8206055941activity span {font-weight:700;}#yiv8206055941 #yiv8206055941activity span:first-child {text-transform:uppercase;}#yiv8206055941 #yiv8206055941activity span a {color:#5085b6;text-decoration:none;}#yiv8206055941 #yiv8206055941activity span span {color:#ff7900;}#yiv8206055941 #yiv8206055941activity span .yiv8206055941underline {text-decoration:underline;}#yiv8206055941 .yiv8206055941attach {clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 0;width:400px;}#yiv8206055941 .yiv8206055941attach div a {text-decoration:none;}#yiv8206055941 .yiv8206055941attach img {border:none;padding-right:5px;}#yiv8206055941 .yiv8206055941attach label {display:block;margin-bottom:5px;}#yiv8206055941 .yiv8206055941attach label a {text-decoration:none;}#yiv8206055941 blockquote {margin:0 0 0 4px;}#yiv8206055941 .yiv8206055941bold {font-family:Arial;font-size:13px;font-weight:700;}#yiv8206055941 .yiv8206055941bold a {text-decoration:none;}#yiv8206055941 dd.yiv8206055941last p a {font-family:Verdana;font-weight:700;}#yiv8206055941 dd.yiv8206055941last p span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv8206055941 dd.yiv8206055941last p span.yiv8206055941yshortcuts {margin-right:0;}#yiv8206055941 div.yiv8206055941attach-table div div a {text-decoration:none;}#yiv8206055941 div.yiv8206055941attach-table {width:400px;}#yiv8206055941 div.yiv8206055941file-title a, #yiv8206055941 div.yiv8206055941file-title a:active, #yiv8206055941 div.yiv8206055941file-title a:hover, #yiv8206055941 div.yiv8206055941file-title a:visited {text-decoration:none;}#yiv8206055941 div.yiv8206055941photo-title a, #yiv8206055941 div.yiv8206055941photo-title a:active, #yiv8206055941 div.yiv8206055941photo-title a:hover, #yiv8206055941 div.yiv8206055941photo-title a:visited {text-decoration:none;}#yiv8206055941 div#yiv8206055941ygrp-mlmsg #yiv8206055941ygrp-msg p a span.yiv8206055941yshortcuts {font-family:Verdana;font-size:10px;font-weight:normal;}#yiv8206055941 .yiv8206055941green {color:#628c2a;}#yiv8206055941 .yiv8206055941MsoNormal {margin:0 0 0 0;}#yiv8206055941 o {font-size:0;}#yiv8206055941 #yiv8206055941photos div {float:left;width:72px;}#yiv8206055941 #yiv8206055941photos div div {border:1px solid #666666;min-height:62px;overflow:hidden;width:62px;}#yiv8206055941 #yiv8206055941photos div label {color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv8206055941 #yiv8206055941reco-category {font-size:77%;}#yiv8206055941 #yiv8206055941reco-desc {font-size:77%;}#yiv8206055941 .yiv8206055941replbq {margin:4px;}#yiv8206055941 #yiv8206055941ygrp-actbar div a:first-child {margin-right:2px;padding-right:5px;}#yiv8206055941 #yiv8206055941ygrp-mlmsg {font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv8206055941 #yiv8206055941ygrp-mlmsg table {font-size:inherit;font:100%;}#yiv8206055941 #yiv8206055941ygrp-mlmsg select, #yiv8206055941 input, #yiv8206055941 textarea {font:99% Arial, Helvetica, clean, sans-serif;}#yiv8206055941 #yiv8206055941ygrp-mlmsg pre, #yiv8206055941 code {font:115% monospace;}#yiv8206055941 #yiv8206055941ygrp-mlmsg * {line-height:1..22em;}#yiv8206055941 #yiv8206055941ygrp-mlmsg #yiv8206055941logo {padding-bottom:10px;}#yiv8206055941 #yiv8206055941ygrp-msg p a {font-family:Verdana;}#yiv8206055941 #yiv8206055941ygrp-msg p#yiv8206055941attach-count span {color:#1E66AE;font-weight:700;}#yiv8206055941 #yiv8206055941ygrp-reco #yiv8206055941reco-head {color:#ff7900;font-weight:700;}#yiv8206055941 #yiv8206055941ygrp-
Yang membuat saya penasaran, mengapa hanya terjadi pada 2 baris itu saja.
Salam,
HK
Sent from Yahoo Mail on Android
On Sun, May 26, 2019 at 4:34, 'Mr. Kid' mr.nmkid@gmail.com [belajar-excel]<belajar-excel@yahoogroups.com> wrote:
Mungkin karena round
Sent from my smart enough phone
On May 25, 2019, at 20:48, hendrik karnadi hendrikkarnadi@yahoo.com [belajar-excel] <belajar-excel@yahoogroups.com> wrote:
Dear Be-Excel,
Untuk mengisi waktu luang di malam minggu, saya mencoba me-lihat2 kembali warisan Alm. Mbak Siti (Senior kita).Di situ saya menemukan UDF untuk menghitung Penghasilan Kena Pajak, yang secara aturan dibulatkan kebawah (dalam ribuan).
Dalam Worksheet terlampir (saya revisi hanya untuk th 2009), beliau memperbandingkan hasil perhitungan UDF dengan Formula.
UDF nya adalah sebagai berikut:Option Explicit
Function fPPh21_2009(
Formula pada baris 12 dan 13 adalah sbb:=IF(C12<
=IF(C13<=
Hasilnya seharusnya sama tapi berbeda beberapa ratus rupiah hanya pada kedua baris ini.
Pertanyaan saya (bukan ngetes):Apa yang menyebabkan terjadinya perbedaan tsb ?
Untuk lebih jelasnya saya lampirkan workbooknya.
Terima kasih.
Salam,HK
<UDF_fPPh21 (Rev by HK - Single to Double).xls>
#yiv8206055941 #yiv8206055941 -- #yiv8206055941ygrp-