Hi,
One way is the following UDF
First name your Sheet1 range B3:D6 "Data"
Then in G4 enter the first month and in H4 the second month
Then in a cell enter the formula
Formula:
=Words(G4,H4,C3,"M")
The 4th parameter should be eithet "M" for minus or "P" for plus
See also attached
Function Words(stM1 As String, stM2 As String, stItem As String, stsign As String) As String
Dim lVal1 As Long, lval2 As Long, x1 As Long, x2 As Long, y As Long, lResult As Long, stText As String, sttext2 As String
x1 = WorksheetFunction.Match(stM1, Range("Data").Resize(, 1), False) '.Find(What:=stM1, after:=Range("Data").Cells(1, 1)).Row
y = WorksheetFunction.Match(stItem, Range("Data").Resize(1), False)
x2 = WorksheetFunction.Match(stM2, Range("Data").Resize(, 1), False)
lVal1 = Range("Data").Cells(x2, y)
lval2 = Range("Data").Cells(x1, y)
Select Case stsign
Case Is = "M"
lResult = lval2 - lVal1
stText = "Take away "
sttext2 = " from "
Case Is = "P"
lResult = lval2 + lVal1
stText = "Add "
sttext2 = " to "
End Select
Words = stText & stM2 & " " & stItem & " of " & lVal1 & sttext2 & stM1 & " " & stItem & " of " _
& lval2 & " to get " & stM1 & "/" & stM2 & " " & stItem & " of " & lResult
End Function
Bookmarks