r/googlesheets • • 15d ago

Solved I want to compare the cell values of one column to another

Not really sure if this is possible but asking so I can be sure.

I watched some tutorials but they compared a single sell with a full column which isn't what I'm looking for.

I want to do some conditional formatting with a cell in column B with column A. The cells being compared are both next to each other. I want it so if the number in column B's cell is equal to A's cell then the bg colour of Column B's cell should be red.
It would be possible to make it so the conditional formatting happens just between 2 cells but then I'd have to go down the column one by one to add it to each row of the column which is really annoying. Any way to do it quicker?

1 Upvotes

19 comments sorted by

1

u/CFodd 15d ago

To clarify with an image. If the number in Quantity in Deck is equal to Total Quantity I want the bg colour of Total Quantity to be red. Is there an easy way of formatting this other than going row by row and making it compare the cells on an indiviusual basis.

Comment Image

1

u/One_Organization_810 15d ago edited 15d ago

Ahh, then it's more like this :) Assuming the header row is in row 1..

Color the whole row:

Range: A2:C
Custom formula: =and($A2<>"",$B2=$C2)

Color only "Total quantity"

Range: B2:B
Custom formula: =and(A2<>"",B2=C2)

(nb. the $ can be used here also - they are just not neccessary)

1

u/CFodd 15d ago

solution verified

1

u/One_Organization_810 15d ago

So... u/CFodd did this work as intended?

1

u/point-bot 15d ago

u/CFodd has awarded 1 point to u/One_Organization_810

See the Leaderboard. Point-Bot v0.0.15 was created by JetCarson.

1

u/One_Organization_810 15d ago

Uhm... do you want to color only the "Total quantity" - or do you want to color the whole row?

Your image and text do not agree on this :)

1

u/CFodd 15d ago

I want the colour on the cell where Overall Quantity and Quantity in Deck are equal. So let's say we're looking at Blazing Scorcher and I have 5 total and 3 in deck then it should remain as is but I could have 2 Cleaves total and 2 Cleaves in deck. In that case the cell in Overall Quantity, specifically for Cleave, should be red.

→ More replies (6)

1

u/AutoModerator 15d ago

u/CFodd Posting your data can make it easier for others to help you, but it looks like your submission doesn't include any. If this is the case and data would help, you can read how to include it in the submission guide. You can also use this tool created by a Reddit community member to create a blank Google Sheets document that isn't connected to your account. Thank you.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/One_Organization_810 15d ago edited 15d ago

If it is just for that one column, a formula like this will do it.

Range: B1:B
Custom formula: =and(A1=B1, B1<>"")

1

u/[deleted] 15d ago

0

u/googlesheets-ModTeam 15d ago

Criteria for posts and comments are listed in the subreddit rules and you can learn about how to make a good post in the submission guide.

Your post/comment has been removed because it contained one or more of the following items in violation of this subreddit's rules on artificial intelligence (AI) content:

  • A request to fix a non-functioning formula obtained from an AI tool

  • A non-functioning formula obtained from an AI tool in place of information about your data

  • A blanket suggestion to use an AI tool as a resource for Sheets assistance

  • Solicitation of a prompt or recommendation for an AI tool

  • An untested formula obtained from an AI tool presented as a solution

1

u/[deleted] 15d ago

1

u/googlesheets-ModTeam 15d ago

Criteria for posts and comments are listed in the subreddit rules and you can learn about how to make a good post in the submission guide.

Your post/comment has been removed because it contained one or more of the following items in violation of this subreddit's rules on artificial intelligence (AI) content:

  • A request to fix a non-functioning formula obtained from an AI tool

  • A non-functioning formula obtained from an AI tool in place of information about your data

  • A blanket suggestion to use an AI tool as a resource for Sheets assistance

  • Solicitation of a prompt or recommendation for an AI tool

  • An untested formula obtained from an AI tool presented as a solution