ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¦Û­q¨ç¼Æ¡G¸ó¤u§@ªí½d³ò¤Þ¼Æ¥X²{¿ù»~

[µo°Ý] ¦Û­q¨ç¼Æ¡G¸ó¤u§@ªí½d³ò¤Þ¼Æ¥X²{¿ù»~

½Ð°Ý¦U¦ì°ª¤â
  1. Function avg(Rng As Range, dataN%)
  2. Dim xRng As Range, Tf As Boolean
  3. Set xRng = Range(Rng, Rng.Offset(0, dataN - 1))
  4. Tf = WorksheetFunction.Count(xRng) = dataN
  5. If Tf Then
  6.     avg = WorksheetFunction.Average(xRng)
  7. Else
  8.     avg = ""
  9. End If
  10. End Function
½Æ»s¥N½X
¦bset xrng ³B¡A°õ¦æ¤¤¦]¬°·|¶Ç¤J¤£¦P¤u§@ªíªº½d³ò¡A¦ý¦b°õ¦æ®É¥X²{¡uÀ³¥Îµ{¦¡©Îª«¥ó©w¸q¤Wªº¿ù»~¡v
Àˬd¸ê®Æ®É¡A¤]¨Ã¨Sµo²{°_©l½d³ò¤£¹ï¡A°¾°¾¥Î°j°é¥á¤J½d³ò¤ÎdataN®É¡A·|¤£©w®Éµo¥Í¿ù»~
¸Ó¨ç¼Æ¬O¤£¬O¦³§ó¦nªº¼gªk¡H

³Â·Ð¤j®a¤£§[«ü±Ð¡AÁÂÁÂ
¤£¶i«h°h

¦^´_ 1# mnsmrtl
  1. Function avg(Rng As Range, dataN%)
  2.     Dim xRng As Range, Tf As Boolean
  3.     If dataN% = 0 Then Exit Function
  4.     Set xRng = Range(Rng, Rng.Offset(0, dataN - 1))
  5.     Tf = WorksheetFunction.Count(xRng) = dataN
  6.     If Tf Then
  7.         avg = WorksheetFunction.Average(xRng)
  8.     Else
  9.         avg = ""
  10.     End If
  11. End Function
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

·PÁ¦^´_¡A¤w¸Ñ¨M~~
¤£¶i«h°h

TOP

        ÀR«ä¦Û¦b : ¤p¨Æ¤£°µ¡B¤j¨ÆÃø¦¨¡C
ªð¦^¦Cªí ¤W¤@¥DÃD