I'm working on a function in Excel that will allow me to sum columns if the column before it contains the word "pre"
here's a mock spreadsheet:
Grade Points Possible
C++ Pre Test 20 20
Homework Week 1 30 30
C++ Test 90 100
Now I want to use the SUMIF() function with a SEARCH() function nested in it that will examine cells A2 through A4 and if the word 'pre' is found it will sum the appropriate number in column B.
Here's what I have so far that doesn't seem to be working:
=SUMIF(A2:A4,SEARCH("pre",A2:A4),B2:B4)
What I intend for this to say is "If the word 'pre' is found in any cell in the range a2:a4, pull the value from its corresponding grade in column b". The output I am expecting with the mock spreadsheet is '20' since pre only appears once.
Perhaps a VB macro would be in order?
EDIT: Upon further investigation maybe the LOOKUP() function may be best suited since SEARCH() is used to return a value from the column it's searching.