[Solved] SUMIF search criteria
[Solved] SUMIF search criteria
I'm trying to use the SUMIF function, but am unable to make it work the way i'd like. Instead of specifying the entire value for the search criteria, i'd like to be able to select records based on the first X number of characters in this field. For example, if the first 10 characters were always ACCOUNTING, but the rest of the field varied, is there a way to select records based only on the first 10 characters of the field? Hope i explained myself correctly.
Last edited by Hagar Delest on Fri Feb 16, 2018 10:40 pm, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
Rob
Re: SUMIF search criteria
Try a formula like
Be sure that regular expressions are enabled in the menu Tools -> Options -> OpenOffice Calc -> Calculate
Code: Select all
=SUMIF(D2:D7;"^accounting.*";E2:E7)
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: SUMIF search criteria
You may be even more flexible using SUMPRODUCT(). Assume column A is containing words and column B contains associated amounts.
If D2 now conatins a common keyword to find at the beginning of the words in column B for including the associated amount in the sum, you may use or similar.
If D2 now conatins a common keyword to find at the beginning of the words in column B for including the associated amount in the sum, you may use
Code: Select all
=SUMPRODUCT(B2:B101;LEFT(A2:A101;LEN(D2))=D2)
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
Re: SUMIF search criteria
FJCC this works exactly the way i wanted it to. Thank you, thank you, thank you.
Rob