Forum Discussion
Ignore Row with Text Using VLOOKUP
To skip the cells with PTS, you can use the IF function to check if the cell contains text. If it does, you can return an empty string. Otherwise, you can return the value of the cell.
Here is an example of how to use the IF function to skip the cells with PTS:
=IF(ISTEXT(cell), "", VLOOKUP(cell, lookup_table, col_index_num, range_lookup))
In this formula, the cell parameter is the cell that you want to check. The lookup_table parameter is the table that you want to search. The col_index_num parameter is the column number in the lookup table that contains the value that you want to find. The range_lookup parameter is a logical value that determines whether to search for an exact match or an approximate match.
Here is an example of how to use the formula to count the number of times that a player has been over or under a value in the last 3 games:
=SUMIF(A5:A27, E2, IF(ISTEXT(A5:A27), "", VLOOKUP(A5:A27, Points, 2, FALSE))) + SUMIF(A5:A27, H2, IF(ISTEXT(A5:A27), "", VLOOKUP(A5:A27, Points, 2, FALSE)))
In this formula, the A5:A27 range contains the last 3 games. The E2 and H2 cells contain the vegas line for the specific stat of the player. The Points sheet contains the previous 15 games of data.
This formula will count the number of times that the player has gone over or under the vegas line in the last 3 games. If a cell in the A5:A27 range contains text, then the formula will ignore that cell and count an additional cell. The text and steps were edited with the help of AI.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and Like it!
This will help all forum participants.
I am confused about the final formula. Can you clarify what you mean by A5:A27 is referencing the last three games? Which sheet were you referencing? Because new rows are added with each new game, I have it set up to pull the values for those games across a row for each player (Points sheet, rows C-Q).
Also, with VLOOKUP wouldn't you want to have the first argument of the formula to be a single cell for comparison followed by a range?
Thank you for taking the time to answer!
- NikolinoDEDec 24, 2023Platinum Contributor
You would insert the formula in the "PointsOU" sheet, in the cell where you want to display the results. For example, if you want to display the results in cell C4, you would insert the following formula:
=SUMIF(Points!Last3Games, E2, IF(ISTEXT(Points!Last3Games), "", VLOOKUP(Points!Last3Games, Points!R:S, 2, FALSE))) + SUMIF(Points!Last3Games, H2, IF(ISTEXT(Points!Last3Games), "", VLOOKUP(Points!Last3Games, Points!R:S, 2, FALSE)))
If you want to display the results for the last 5 games, you would insert the following formula:
=SUMIF(Points!Last5Games, E2, IF(ISTEXT(Points!Last5Games), "", VLOOKUP(Points!Last5Games, Points!R:S, 2, FALSE))) + SUMIF(Points!Last5Games, H2, IF(ISTEXT(Points!Last5Games), "", VLOOKUP(Points!Last5Games, Points!R:S, 2, FALSE)))
And if you want to display the results for the last 10 games, you would insert the following formula:
=SUMIF(Points!Last10Games, E2, IF(ISTEXT(Points!Last10Games), "", VLOOKUP(Points!Last10Games, Points!R:S, 2, FALSE))) + SUMIF(Points!Last10Games, H2, IF(ISTEXT(Points!Last10Games), "", VLOOKUP(Points!Last10Games, Points!R:S, 2, FALSE)))
Please ensure that the references match the actual sheet and cell locations in your workbook.
Note that due to differences in syntax and functions between Excel and Google Sheets, complex formulas might need adjustment when moving between the two platforms.
I think I'm at my wits' end when it comes to Google Sheets. I would recommend additionally asking Google Sheets.