Conditional Format ISBLANK NOT AND IF ?? based on 2 cell values

GaryCee

New Member
Joined
Mar 20, 2017
Messages
5
Hello

Any help is much appreciated! I have a spreadsheet where I log materials invoices and I would like to highlight a cell if it contains the supplier but I have forgotten to enter the invoice amount (and vice versa).

So if I have an invoice for Smiths and I enter the Supplier in A2 but if I forget to input the invoice amount in B2 I would like to highlight B2 as it is empty.

Similarly I would like to highlight A2 if I enter the amount in B2 but A2 is empty as I have forgotten to enter the supplier name.

Thank you!

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Supplier[/TD]
[TD]Amount[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Smiths [/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Jones[/TD]
[TD]£3.00[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Bloggs[/TD]
[TD]£4.00[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Highlight A2:B100 (or however far down you want to go) > Conditional Formatting > New Rule > Use a formula

=AND(COUNTIF(A2,""),COUNTIF($A2:$B2,"<>"))

Format: Fill however you'd like > OK
 
Upvote 0
OK. You will have two rules.

First, for column A, highlight cells A2:A4, go to Conditional Formatting, choose the formula option, and use this formula:
Code:
=AND($A2="",$B2<>"")
then choose your formatting option and click OK.


First, for column A, highlight cells B2:B4, go to Conditional Formatting, choose the formula option, and use this formula:
Code:
=AND($A2=<>,$B2="")
then choose your formatting option and click OK.
 
Upvote 0
Select Column A and use this as the Conditional Formatting Formula:
=AND($A1="",$B1<>"")

Select Column B and use this as the Conditional Formatting Formula:
=AND($A1<>"",$B1="")
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

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