arkadaşlar harfleri nasıl saydırabiliriz yardımcı olurmusunuz

Katılım
15 Şubat 2007
Mesajlar
336
Excel Vers. ve Dili
xp
a1 hücresine b yazdım a2 hücresine b yazdım a3 hücresinede c yazdım
toplam : 2b
toplam: 1c

bu toplamı nasıl yaptırabilirim yardımcı olurmusunuz arkadaşlar
 

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
Merhaba.
Bende makro ile bir şeyler yaptım A sütununda "a", "b" veya "c" olarak girilen değerleri toplar B1 hücresine yazar.
İyi çalışmalar.:cool:
Kod:
Sub harf_topla()
Dim a As Long, b As Long, c As Long, harf As String
Dim sonsat As Long, i As Long
'harfler = Array(harfler, "a,b,c,ç,d,e,f,g,ğ,h,ı,i,j,k,l,m,n,o,p,q,r,s,ş,t,u,v,w,x,y,z")
sonsat = Cells(65536, "A").End(xlUp).Row
For i = 1 To sonsat
    harf = LCase(Cells(i, "A").Value)
    If harf = "a" Then a = a + 1
    If harf = "b" Then b = b + 1
    If harf = "c" Then c = c + 1
Next
If a > 0 Then Range("B1").Value = "a = " & a
If b > 0 Then Range("B1").Value = Range("B1").Value & ", b = " & b
If c > 0 Then Range("B1").Value = Range("B1").Value & ", c = " & c
End Sub
 
Son düzenleme:

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
Merhaba.
Yeniden güncelledim.A sütununa tek harf girilmişse.!
U ve Ü harflerini toplamıyordu düzeltildi.
Makro ile A sütununda bütün harfleri saydırıp ,kaçtane olduğunu B1 hücresine yazar.:cool:
Kod:
Sub Harf_Topla()
Dim a As Long, b As Long, c As Long, c2 As Long, d As Long, e As Long, f As Long
Dim g As Long, g2 As Long, h As Long, i1 As Long, i2 As Long, j As Long
Dim k As Long, l As Long, m As Long, n As Long, o As Long, ö As Long, p As Long, q As Long
Dim r As Long, s As Long, ş As Long, t As Long, u As Long, ü As Long, v As Long, w As Long
Dim x As Long, y As Long, z As Long
Dim i5 As Long, sonsat As Long, harf As String, sonuc As String
sonsat = Cells(65536, "A").End(xlUp).Row
For i5 = 1 To sonsat
    harf = LCase(Replace(Replace(Cells(i5, "A").Value, "I", "ı"), "İ", "i"))
    If harf = "a" Then a = a + 1
    If harf = "b" Then b = b + 1
    If harf = "c" Then c = c + 1
    If harf = "ç" Then c2 = c2 + 1
    If harf = "d" Then d = d + 1
    If harf = "e" Then e = e + 1
    If harf = "f" Then f = f + 1
    If harf = "g" Then g = g + 1
    If harf = "ğ" Then g2 = g2 + 1
    If harf = "h" Then h = h + 1
    If harf = "ı" Then i1 = i1 + 1
    If harf = "i" Then i2 = i2 + 1
    If harf = "j" Then j = j + 1
    If harf = "k" Then k = k + 1
    If harf = "l" Then l = l + 1
    If harf = "m" Then m = m + 1
    If harf = "n" Then n = n + 1
    If harf = "o" Then o = o + 1
    If harf = "ö" Then ö = ö + 1
    If harf = "p" Then p = p + 1
    If harf = "q" Then q = q + 1
    If harf = "r" Then r = r + 1
    If harf = "s" Then s = s + 1
    If harf = "ş" Then ş = ş + 1
    If harf = "t" Then t = t + 1
    If harf = "u" Then u = u + 1
    If harf = "ü" Then ü = ü + 1
    If harf = "v" Then v = v + 1
    If harf = "w" Then w = w + 1
    If harf = "x" Then x = x + 1
    If harf = "y" Then y = y + 1
    If harf = "z" Then z = z + 1
Next
If a > 0 Then sonuc = "a = " & a
If b > 0 Then sonuc = sonuc & ", b = " & b
If c > 0 Then sonuc = sonuc & ", c = " & c
If c2 > 0 Then sonuc = sonuc & ", ç = " & c2
If d > 0 Then sonuc = sonuc & ", d = " & d
If e > 0 Then sonuc = sonuc & ", e = " & e
If f > 0 Then sonuc = sonuc & ", f = " & f
If g > 0 Then sonuc = sonuc & ", g = " & g
If g2 > 0 Then sonuc = sonuc & ", ğ = " & g2
If h > 0 Then sonuc = sonuc & ", h = " & h
If i1 > 0 Then sonuc = sonuc & ", ı = " & i1
If i2 > 0 Then sonuc = sonuc & ", i = " & i2
If j > 0 Then sonuc = sonuc & ", j = " & j
If k > 0 Then sonuc = sonuc & ", k = " & k
If l > 0 Then sonuc = sonuc & ", l = " & l
If m > 0 Then sonuc = sonuc & ", m = " & m
If n > 0 Then sonuc = sonuc & ", n = " & n
If o > 0 Then sonuc = sonuc & ", o = " & o
If ö > 0 Then sonuc = sonuc & ", ö = " & ö
If p > 0 Then sonuc = sonuc & ", p = " & p
If q > 0 Then sonuc = sonuc & ", q = " & q
If r > 0 Then sonuc = sonuc & ", r = " & r
If s > 0 Then sonuc = sonuc & ", s = " & s
If ş > 0 Then sonuc = sonuc & ", ş = " & ş
If t > 0 Then sonuc = sonuc & ", t = " & t
If u > 0 Then sonuc = sonuc & ", u = " & u
If ü > 0 Then sonuc = sonuc & ", ü = " & ü
If v > 0 Then sonuc = sonuc & ", v = " & v
If w > 0 Then sonuc = sonuc & ", w = " & w
If x > 0 Then sonuc = sonuc & ", x = " & x
If y > 0 Then sonuc = sonuc & ", y = " & y
If z > 0 Then sonuc = sonuc & ", z = " & z
Range("B1").Value = sonuc
End Sub
 
Son düzenleme:

Ali

Uzman
Katılım
21 Temmuz 2005
Mesajlar
7,896
Excel Vers. ve Dili
İş:Excel 2016-Türkçe
Eğer sadece tek harften oluşuyorsa a gibi o zaman V.Basic For Applications'ın verdiği gibi eğersay yeterli olacaktır ama Ankara gibi birden çok harf geçen kelimelerdeki harfler sayılacaksa Eğersay çalışmayacaktır.

Bu durumda hepsinde geçen küçük harfleri saymak için;

B1'e aranması istenen değer yazılmış olsun a gibi.

C1'e

Kod:
=TOPLA.ÇARPIM(UZUNLUK(A1:A100)-UZUNLUK(YERİNEKOY(A1:A100;B1;"")))
ya da

Kod:
=TOPLA.ÇARPIM(ÖZDEŞ(A1:A100;B1)+0)
Büyük küçük harf farketmeden hepsini saydırmak istersek;


Kod:
=TOPLA.ÇARPIM(UZUNLUK(A1:A100)-UZUNLUK(YERİNEKOY(KÜÇÜKHARF(A1:A100);B1;"")))
yazılabilir.
 

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
Merhaba.
Yukarıdaki mesajımda U ve Ü harflerini saymadığını tesbit ettim ve o kodlarda düzeltme yaptım.Ayrıca;
Aşağıdaki kodlarda Kodların KTF(Kullanıcı Tanımlı Fonksiyon) şeklini yaptım.
Bu kodları boş bir modüle kopyalıyorsunuz.Ve bir hücreye aşağıdaki formülü yazıyorsunuz.
A2:C6 rastgele bir seçimdir .Siz istediğiniz seçimi yapabilirsiniz.

=harf_topla(A2:C6;1)

İyi çalışmalar.:cool:
Kod:
Function Harf_Topla(dizi As Range, kriter as Byte)
Dim a As Long, b As Long, c As Long, c2 As Long, d As Long, e As Long, f As Long
Dim g As Long, g2 As Long, h As Long, i1 As Long, i2 As Long, j As Long
Dim k As Long, l As Long, m As Long, n As Long, o As Long, ö As Long, p As Long, q As Long
Dim r As Long, s As Long, ş As Long, t As Long, u As Long, ü As Long, v As Long, w As Long
Dim x As Long, y As Long, z As Long
Dim harf As String, sonuc As String
For Each hucre In dizi
    harf = LCase(Replace(Replace(hucre, "I", "ı"), "İ", "i"))
    If harf = "a" Then a = a + 1
    If harf = "b" Then b = b + 1
    If harf = "c" Then c = c + 1
    If harf = "ç" Then c2 = c2 + 1
    If harf = "d" Then d = d + 1
    If harf = "e" Then e = e + 1
    If harf = "f" Then f = f + 1
    If harf = "g" Then g = g + 1
    If harf = "ğ" Then g2 = g2 + 1
    If harf = "h" Then h = h + 1
    If harf = "ı" Then i1 = i1 + 1
    If harf = "i" Then i2 = i2 + 1
    If harf = "j" Then j = j + 1
    If harf = "k" Then k = k + 1
    If harf = "l" Then l = l + 1
    If harf = "m" Then m = m + 1
    If harf = "n" Then n = n + 1
    If harf = "o" Then o = o + 1
    If harf = "ö" Then ö = ö + 1
    If harf = "p" Then p = p + 1
    If harf = "q" Then q = q + 1
    If harf = "r" Then r = r + 1
    If harf = "s" Then s = s + 1
    If harf = "ş" Then ş = ş + 1
    If harf = "t" Then t = t + 1
    If harf = "u" Then u = u + 1
    If harf = "ü" Then ü = ü + 1
    If harf = "v" Then v = v + 1
    If harf = "w" Then w = w + 1
    If harf = "x" Then x = x + 1
    If harf = "y" Then y = y + 1
    If harf = "z" Then z = z + 1
Next
If a > 0 Then sonuc = "a = " & a
If b > 0 Then sonuc = sonuc & ", b = " & b
If c > 0 Then sonuc = sonuc & ", c = " & c
If c2 > 0 Then sonuc = sonuc & ", ç = " & c2
If d > 0 Then sonuc = sonuc & ", d = " & d
If e > 0 Then sonuc = sonuc & ", e = " & e
If f > 0 Then sonuc = sonuc & ", f = " & f
If g > 0 Then sonuc = sonuc & ", g = " & g
If g2 > 0 Then sonuc = sonuc & ", ğ = " & g2
If h > 0 Then sonuc = sonuc & ", h = " & h
If i1 > 0 Then sonuc = sonuc & ", ı = " & i1
If i2 > 0 Then sonuc = sonuc & ", i = " & i2
If j > 0 Then sonuc = sonuc & ", j = " & j
If k > 0 Then sonuc = sonuc & ", k = " & k
If l > 0 Then sonuc = sonuc & ", l = " & l
If m > 0 Then sonuc = sonuc & ", m = " & m
If n > 0 Then sonuc = sonuc & ", n = " & n
If o > 0 Then sonuc = sonuc & ", o = " & o
If ö > 0 Then sonuc = sonuc & ", ö = " & ö
If p > 0 Then sonuc = sonuc & ", p = " & p
If q > 0 Then sonuc = sonuc & ", q = " & q
If r > 0 Then sonuc = sonuc & ", r = " & r
If s > 0 Then sonuc = sonuc & ", s = " & s
If ş > 0 Then sonuc = sonuc & ", ş = " & ş
If t > 0 Then sonuc = sonuc & ", t = " & t
If u > 0 Then sonuc = sonuc & ", u = " & u
If ü > 0 Then sonuc = sonuc & ", ü = " & ü
If v > 0 Then sonuc = sonuc & ", v = " & v
If w > 0 Then sonuc = sonuc & ", w = " & w
If x > 0 Then sonuc = sonuc & ", x = " & x
If y > 0 Then sonuc = sonuc & ", y = " & y
If z > 0 Then sonuc = sonuc & ", z = " & z
If kriter = 1 Then
    Harf_Topla = sonuc
End If
End Function
 
Son düzenleme:
Üst