Hi!
I'm trying to count the number of times a phrase occurs across a sheet based on a qualifier in the row. The user enters a date and I want excel to first check the date in a row. If that date comes before (or is equal to) the date the user enters, excel should search the rest of the row for that phrase and count it. If the date falls after the user date any instance of the phrase in that row should be ignored. So if the user enters 1/2/18 and the search is for "BABB" the result should be 3 based on the table below:
[TABLE="width: 500"]
<tbody>[TR]
[TD]User Date:[/TD]
[TD]1/2/18[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1/1/18[/TD]
[TD]IMIT[/TD]
[TD]BABB[/TD]
[TD]BABB[/TD]
[TD]SPON[/TD]
[/TR]
[TR]
[TD]1/2/18[/TD]
[TD]BABB[/TD]
[TD]SPON[/TD]
[TD]SPON[/TD]
[TD]RESP[/TD]
[/TR]
[TR]
[TD]1/3/18[/TD]
[TD]BABB[/TD]
[TD]IMIT[/TD]
[TD]BABB[/TD]
[TD]BABB[/TD]
[/TR]
</tbody>[/TABLE]
This formula counts a single row, but I'm hoping to apply it to every row (I have a few thousand) and get a single number returned: =IF(A2 <= B1, COUNTIF(B2:E2, "BABB"), "0"). Any ideas how to apply that using a formula or VBA? Thank you!!!<style></style><style></style>
I'm trying to count the number of times a phrase occurs across a sheet based on a qualifier in the row. The user enters a date and I want excel to first check the date in a row. If that date comes before (or is equal to) the date the user enters, excel should search the rest of the row for that phrase and count it. If the date falls after the user date any instance of the phrase in that row should be ignored. So if the user enters 1/2/18 and the search is for "BABB" the result should be 3 based on the table below:
[TABLE="width: 500"]
<tbody>[TR]
[TD]User Date:[/TD]
[TD]1/2/18[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1/1/18[/TD]
[TD]IMIT[/TD]
[TD]BABB[/TD]
[TD]BABB[/TD]
[TD]SPON[/TD]
[/TR]
[TR]
[TD]1/2/18[/TD]
[TD]BABB[/TD]
[TD]SPON[/TD]
[TD]SPON[/TD]
[TD]RESP[/TD]
[/TR]
[TR]
[TD]1/3/18[/TD]
[TD]BABB[/TD]
[TD]IMIT[/TD]
[TD]BABB[/TD]
[TD]BABB[/TD]
[/TR]
</tbody>[/TABLE]
This formula counts a single row, but I'm hoping to apply it to every row (I have a few thousand) and get a single number returned: =IF(A2 <= B1, COUNTIF(B2:E2, "BABB"), "0"). Any ideas how to apply that using a formula or VBA? Thank you!!!<style></style><style></style>