Reference Found Cell in Column & Search The Adjacent Cell

Pandize

New Member
Joined
Jul 13, 2018
Messages
4
Hello,

So the formula I am trying to create is described as this;
Search column for specific text, if text is found, then search the cell to the left of the found cell for specific text. If the text is true, count.

Currently what I've tried is the following;
=SUM(COUNTIFS(D:D,{"TEST1","TEST2"},C:C,"(TEST3)"))

The problem is column C. Instead of searching the whole column, I want it to search the cell next to the one where TEST1 or TEST2 was found for TEST3.
This should apply for all of column D, if it finds any more text matching TEST1 or TEST2, it will search the adjacent ones as well.

Hopefully this isn't as difficult for some of you guys as it has been for me!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Welcome to Mr Excel forum

I think you formula has typos
=SUM(COUNTIFS(D:D,{"TEST1","TEST2"},C:C,"(TEST3)"))

Shouldn't it be
=SUM(COUNTIFS(D:D,{"TEST1","TEST2"},C:C,"TEST3"))

M.
 
Upvote 0
Oh, yes. The specific text that I was searching for contained () in it, I just never removed it when replacing the text with "TEST".
 
Upvote 0
So, the formula works now, or not?

M.

The formula that I showed doesn't work how I want it to right now.
C:C is checking the entire column, but I want it to check the adjacent cell that is found by the first section. See;

The problem is column C. Instead of searching the whole column, I want it to search the cell next to the one where TEST1 or TEST2 was found for TEST3.
This should apply for all of column D, if it finds any more text matching TEST1 or TEST2, it will search the adjacent ones as well.
 
Upvote 0
Worked for me


C
D
E
F
1
Value1​
Value2​
Formula​
2
TEST3​
TEST1​
3​
3
TEST2​
TEST2​
4
TEST3​
TEST1​
5
TEST3​
TEST4​
6
TEST3​
TEST2​
7
TEST6​
TEST2​

Formula in F2
=SUM(COUNTIFS(D:D,{"TEST1","TEST2"},C:C,"TEST3"))

M.
 
Upvote 0
Worked for me



C

D

E

F

1

Value1​

Value2​

Formula​

2

TEST3​

TEST1​

3​

3

TEST2​

TEST2​

4

TEST3​

TEST1​

5

TEST3​

TEST4​

6

TEST3​

TEST2​

7

TEST6​

TEST2​

<tbody>
</tbody>


Formula in F2
=SUM(COUNTIFS(D:D,{"TEST1","TEST2"},C:C,"TEST3"))

M.

You are correct! I probably just over-thought it or misspelled it. Thanks for the useful graphic!
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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