Check value of cells against condition?

jgruberman

New Member
Joined
Jan 15, 2024
Messages
16
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hello,

I am looking to check a table of sports team names, times and ranking and if their ranking is 3 or lower and their game time is 9pm or later, to flag them somehow, perhaps with another cell with a yes/no or just any sort of identifier that the team fits the specified criteria. Here is an excerpt:

2/49:45 PMWarriors D1Bulldogs D1D1Valley Ranch StarCenterGreen15
2/43:30 PMGRITR D2Fighting Squids D2D2Valley Ranch StarCenterHitchcock54
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
you could use an AND() and will get true or false
not sure where the ranking column is

assuming the time is in column B and the ranking is in column H

=AND( B2 >=timevalue("21:00:00"), H2<=3)

you could use with an IF() to get a YES or NO
=IF( AND( B2 >=timevalue("21:00:00"), H2<=3) , "Yes", "No")

or in conditional formating use a formula

=AND( $B2 >=timevalue("21:00:00"), $H2<=3)

Book5
ABCDEFGHIJK
1
22-Apr9:45 PMWarriors D1Bulldogs D1D1Valley Ranch StarCenterGreen15Yes
32-Apr3:30 PMGRITR D2Fighting Squids D2D2Valley Ranch StarCenterHitchcock54No
4
Sheet1
Cell Formulas
RangeFormula
K2:K3K2=IF( AND( B2 >=TIMEVALUE("21:00:00"), H2<=3), "Yes", "No")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:I3Expression=AND( $B2 >=TIMEVALUE("21:00:00"), $H2<=3)textNO


otherwise
Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet. Plus we cannot see any of the formulas used.

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Upvote 0
You can use Conditional Format Formula to mark them out. But can't find ranking or column headers in the sample data you have shared to give you a formula.
 
Upvote 0
Hello,

I am looking to check a table of sports team names, times and ranking and if their ranking is 3 or lower and their game time is 9pm or later, to flag them somehow, perhaps with another cell with a yes/no or just any sort of identifier that the team fits the specified criteria. Here is an excerpt:
DATETIMEHOME TEAMAWAY TEAMDIVISIONFACILITYRINKHomeAway
2/49:45 PMWarriors D1Bulldogs D1D1Valley Ranch StarCenterGreen15
2/43:30 PMGRITR D2Fighting Squids D2D2Valley Ranch StarCenterHitchcock54
Here is with added header, starting at A1. Sorry about that, new to posting here
 
Upvote 0
i did post best way to post here FY1

and a solution - BUT guessed the ranking column - just change for the actual ranking column

where is the ranking ?
 
Upvote 0
i did post best way to post here FY1

and a solution - BUT guessed the ranking column - just change for the actual ranking column

where is the ranking ?
The ranking is the number values in the last two columns. Each team is ranked by their rink preferences, respectively per team
 
Upvote 0
so are looking for either H or I column if less = 3 to be flagged
if so then
=IF( AND( B2 >=TIMEVALUE("21:00:00"), OR(H2<=3,I2<=3)), "Yes", "No")

Book5
ABCDEFGHIJK
1
22-Apr9:45 PMWarriors D1Bulldogs D1D1Valley Ranch StarCenterGreen15Yes
32-Apr3:30 PMGRITR D2Fighting Squids D2D2Valley Ranch StarCenterHitchcock54No
43-Apr10:45 PM52Yes
Sheet1
Cell Formulas
RangeFormula
K2:K4K2=IF( AND( B2 >=TIMEVALUE("21:00:00"), OR(H2<=3,I2<=3)), "Yes", "No")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:I4Expression=AND( $B2 >=TIMEVALUE("21:00:00"), OR($H2<=3,$I2<=3))textYES
 
Upvote 0
By the way, are you trying to do this in Excel or Google Sheets?
I ask because I see that your previous question was for Google Sheets, and you posted this to the "General Discussion & Other Applications" forum.
 
Upvote 0
I tried the formula posted, but it seems I did something wrong? I think the Away Flag should be "Yes" since it's 10pm and 3.
1706586658405.png
 
Upvote 0

Forum statistics

Threads
1,223,927
Messages
6,175,438
Members
452,641
Latest member
Arcaila

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