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

[µo°Ý] ½Ð°Ý¤ñ¸ûªº¤½¦¡¡H

[µo°Ý] ½Ð°Ý¤ñ¸ûªº¤½¦¡¡H

½Ð°Ý«e½ú°ª¤â
    ÄæA     ÄæB      ÄæC            ÄæD           ÄæE     ÄæF
    20       12      TRUE            32            14

§Ú·Q¼g¤@­Ó¤½¦¡:  ¦pªGÄæC=TRUE ¡A¨º»òÄæB¸òÄæD¡BÄæE¤ñ¸û¡A¦pªGÄæB>ÄæD¡AÄæF¥X²{(¶Ç¦^)  -1

¦pªGÄæB<ÄæE¡AÄæF¥X²{(¶Ç¦^)  1¡A¦pªGÄæB¦bÄæD¤ÎÄæE¤§¶¡(32~14)¡AÄæF¥X²{(¶Ç¦^)  0

¦pªGÄæC¤£µ¥©óTRUE ¡A¨º»òÄæA¸òÄæD¡BÄæE¤ñ¸û¡A¦pªGÄæA>ÄæD¡AÄæF¥X²{(¶Ç¦^)  -1

¦pªGÄæA<ÄæE¡AÄæF¥X²{(¶Ç¦^)  1¡A¦pªGÄæB¦bÄæD¤ÎÄæE¤§¶¡(32~14)¡AÄæF¥X²{(¶Ç¦^)  0

½Ð°ª¤â«üÂI¡A·P¿E¤£ºÉ

¸Õ¸Õ

Sub µ{¦¡()
Sheet1.[F2:F65536].ClearContents
X = Sheet1.[A65536].End(xlUp).Row
For M = 1 To X
    If Sheet1.Cells(M, 3) = True And Sheet1.Cells(M, 2) - Sheet1.Cells(M, 4) > 0 Then
    Sheet1.Cells(M, 6) = -1
    ElseIf Sheet1.Cells(M, 3) = True And Sheet1.Cells(M, 2) - Sheet1.Cells(M, 5) < 0 Then
    Sheet1.Cells(M, 6) = 1
    ElseIf Sheet1.Cells(M, 3) = True And Sheet1.Cells(M, 2) - Sheet1.Cells(M, 5) >= 0 And Sheet1.Cells(M, 2) - Sheet1.Cells(M, 4) <= 0 Then
    Sheet1.Cells(M, 6) = 0
    ElseIf Sheet1.Cells(M, 3) = False And Sheet1.Cells(M, 1) - Sheet1.Cells(M, 4) > 0 Then
    Sheet1.Cells(M, 6) = -1
    ElseIf Sheet1.Cells(M, 3) = False And Sheet1.Cells(M, 1) - Sheet1.Cells(M, 5) < 0 Then
    Sheet1.Cells(M, 6) = 1
    ElseIf Sheet1.Cells(M, 3) = False And Sheet1.Cells(M, 1) - Sheet1.Cells(M, 5) >= 0 And Sheet1.Cells(M, 1) - Sheet1.Cells(M, 4) <= 0 Then
    Sheet1.Cells(M, 6) = 0
    End If
Next
End Sub
ù

TOP

¦^´_ 2# rouber590324

ÁÂÁ    rouber590324¤j¡A§Ú¸Õ¬Ý¬Ý

TOP

=IF(C1,(B1<E1)-(B1>D1),(A1<E1)-(A1>D1))

TOP

¦^´_ 4# ­ã´£³¡ªL


    ÁÂÁ    ­ã´£³¡ªL¤j¡A¯uªº·P¿E¤£ºÉ¡A¤£·\¬O°ª¤â

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¤Hªº§Ö¼Ö¡D¤£¬O¦]¬°¥L¾Ö¦³±o¦h¡A¦Ó¬O¦]¬°¥L­p¸û±o¤Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD