=SUM Formula (Word Search)

bobzy20

New Member
Joined
Feb 5, 2018
Messages
47
Office Version
  1. 2010
Hi,

This will probably be a very simple fix but with limited knowledge of how these formulas work, it isn't easy for me!

I'm using the following formula below and all I want to do is add an additional search word: Q.E.F

=SUM(LEN(Purchases!B:B)-LEN(SUBSTITUTE(Purchases!B:B,"QEF","")))/LEN("QEF")

Any help would be great.

Thanks
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
would you be able to post any sample data you have ?

(and maybe explain what you are trying to do with it a little more please ?)

Rob
 
Upvote 0
How about
Excel Formula:
=SUM(LEN(SUBSTITUTE(Purchases!B:B,".",""))-LEN(SUBSTITUTE(SUBSTITUTE(Purchases!B:B,".",""),"QEF","")))/LEN("QEF")
I would also advise against using whole column references, as it can slow things down.
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
Hi,

Following on from the above, I have now added a new column (££) where I would like to create a formula to calculate the total value for each Name. I will explain below.

Column No. uses the following formula to look at column Name 1 and calculate the number of times it finds the associated word found in the Name 2 column.

=SUM(LEN(A:A)-LEN(SUBSTITUTE(A:A,"PAH","")))/LEN("PAH")

Note: The search word PAH will change to the next word in the Name 2 column as you run down the list.

I'm now looking to calculate the total value associated from column £ with the number found in the No. column. I have manually added them up in the ££ column just to show you.

Hopefully you understand what I have tried to communicate above. :)

Name 1£Name 2No.££
24 08 Apr 24 CF£6.00PAH3£19.50
24 08 Apr 24 CF£2.00CF2£8.00
24 12 Apr 24 BHF£17.50WSB7£22.60
24 12 Apr 24 WSB£2.00BAR0£12.00
24 14 Apr 24 PAH£10.00VF0
24 16 Apr 24 WSB£4.10QEF5£42.50
24 17 Apr 24 WSB£4.10BHF0£17.50
24 18 Apr 24 WSB£4.10BC0£20.00
24 19 Apr 24 PAH£6.00OX0
24 19 Apr 24 QEF£6.00SS0
24 19 Apr 24 Q.E.F£4.00SR0
24 19 Apr 24 Q.E.F£7.50SA0
24 19 Apr 24 QEF£10.00
24 19 Apr 24 QEF£15.00
24 19 Apr 24 WSB£2.10
24 21 Apr 24 PAH£3.50
24 23 Apr 24 BAR£12.00
24 25 Apr 24 WSB£2.10
24 25 Apr 24 WSB£4.10
24 30 Apr 24 BC£20.00
 
Upvote 0
How about
Fluff.xlsm
ABCDEF
2Name 1£Name 2No.££
324 08 Apr 24 CF£6.00PAH319.5
424 08 Apr 24 CF£2.00CF28
524 12 Apr 24 BHF£17.50WSB722.6
624 12 Apr 24 WSB£2.00BAR112
724 14 Apr 24 PAH£10.00VF00
824 16 Apr 24 WSB£4.10QEF542.5
924 17 Apr 24 WSB£4.10BHF117.5
1024 18 Apr 24 WSB£4.10BC120
1124 19 Apr 24 PAH£6.00OX00
1224 19 Apr 24 QEF£6.00SS00
1324 19 Apr 24 Q.E.F£4.00SR00
1424 19 Apr 24 Q.E.F£7.50SA00
1524 19 Apr 24 QEF£10.00
1624 19 Apr 24 QEF£15.00
1724 19 Apr 24 WSB£2.10
1824 21 Apr 24 PAH£3.50
1924 23 Apr 24 BAR£12.00
2024 25 Apr 24 WSB£2.10
2124 25 Apr 24 WSB£4.10
2224 30 Apr 24 BC£20.00
Sheet5
Cell Formulas
RangeFormula
E3:E7,E9:E14E3=COUNTIFS(A:A,"*"&D3)
F3:F7,F9:F14F3=SUMIFS(B:B,A:A,"*"&D3)
E8E8=SUM(COUNTIFS(A:A,{"*QEF","*Q.E.F"}))
F8F8=SUM(SUMIFS(B:B,A:A,{"*QEF","*Q.E.F"}))
 
Upvote 0
Solution
Hi,

Thanks very much that works lovely in the example presented above but not in my spreadsheet because I didn't give you all the information.

My bad, sorry.

When it looks for the words they are amongst other words in a cell, I will give an example below. When its looking for the word PAH, its in the middle of what you see below. Can it possibly be tweaked to search like that?

24 14 Apr 24 PAH THE WALK

Sorry my friend
 
Upvote 0
For both the countifs & sumifs, you just need to add another * to the end like
Excel Formula:
=COUNTIFS(A:A,"*"&D3&"*")
 
Upvote 0
Thanks,

That works really well now apart from the QEF part, does this formula need tweaking, as I know its works sightly different to the others. I'm not sure how to apply the amendment to this part.

Thanks
 
Upvote 0

Forum statistics

Threads
1,222,903
Messages
6,168,939
Members
452,227
Latest member
sam1121

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top