Formula in Word Table - True if a Cell has a Tick (P)

Hi,


I have a Word Table which has 7 Columns x 16 Rows.


In this layout...

  Row 1... Headings.

  Row 16... Totals (I would like to show here - Total Number of Ticks/Total Number of Rows {See Ps. for current codes}).

  Column 1... Day From.

  Column 2... Day To.

  Column 3... Month.

  Column 4... Image.

  Column 5... Title.

  Column 6... Got (Capital 'P', for Tick in 'Wingdings 2').

  Column 7... Where I wish to put the formula, to do the following, if possible...

        If 'F2' = "P" then  1 else 0


The formula can be anything, just needs to Put '1' in Column 7 if Column 6 has a Tick or number of characters = 1 (Plus the End of Cell Ref) so that I can add them to see how many Rows has a 'Tick'.

If this is possible, I will not need to see Column 7 at all, so if it can be hidden, that would be great, but how do I do it?


Thanks,

Neil


Ps.

(0/14) Code { =SUM(F2:F15) }/{ =COUNT(ABOVE)-1 }

Answer
Answer

If you put the selection in Column 6 of Row 16 and then run a macro containing the following code, it will insert the number of Ticks in the cells in Column 6 (Rows 2 to 15) in that cell


Dim i As Long
Dim count As Long
count = 0
With Selection.Tables(1)
    For i = 2 To 15
        If Len(.Cell(i, 6).range.text) > 2 Then
            count = count + 1
        End If
    Next i
End With
Selection.Cells(1).range.text = count

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated November 21, 2023 Views 771 Applies to: