Forum Discussion
BTHeyd
Sep 28, 2022Copper Contributor
IF
I am trying to write a formula that would look something like:
=IF(B2=B1, Copy C2, None)
This formula would be in cell C1. If B2 matches B1 then copy the value from C2 to C1, otherwise do nothing.
Thanks for any help.
- it could be a number of things but basically the text in B33 and B34 aren't EXACTLY the same. It could be an extra space, it could be a non-displayed control character, or something else.
This is one of many reasons why data validation for values like this are so important (i.e. only allow values from a list of valid entries).
How are the values in column B entered? Is this just a 1 off or is this part of a very long list with many similar issues? Why are you even repeating cell information like this anyhow?
6 Replies
- mtarlerSilver Contributorso the formula would be =IF(B2=B1,C2,"") BUT if by "do nothing" you are hoping you can have a value already IN C1 and have that shown, you can NOT a cell can have EITHER a fixed value OR a formula that will dictate the value to be shown. in that case you enter the "do nothing" value in the second part of the IF statement like so: =IF(B2=B1,C2, [enter other value here] )
- BTHeydCopper Contributor
mtarler Thanks for your reply. Strangely this is working for some but not all cells. Below is a sample where the A & S Electric (B Column) match triggered the C column match. But it didn't work for A Capital Electric, Inc. Any idea why?
A & S Electric Inc. 16990 Other Electrical, 16951 Landscape/Outdoor Lighting, 16950 Lighting Package, 16800 Fire Alarm, 16700 Security/Tel/Data Systems, 16050 Electrical A & S Electric Inc. 16990 Other Electrical, 16951 Landscape/Outdoor Lighting, 16950 Lighting Package, 16800 Fire Alarm, 16700 Security/Tel/Data Systems, 16050 Electrical A Capital Electric, Inc. =IF(B33=B34,Q34) A Capital Electric, Inc. 16990 Other Electrical, 16951 Landscape/Outdoor Lighting, 16950 Lighting Package, 16800 Fire Alarm, 16700 Security/Tel/Data Systems, 16050 Electrical - mtarlerSilver Contributorit could be a number of things but basically the text in B33 and B34 aren't EXACTLY the same. It could be an extra space, it could be a non-displayed control character, or something else.
This is one of many reasons why data validation for values like this are so important (i.e. only allow values from a list of valid entries).
How are the values in column B entered? Is this just a 1 off or is this part of a very long list with many similar issues? Why are you even repeating cell information like this anyhow?