If a cell in column is blank when a cell same row is not blank

kcmuppet

Active Member
Joined
Nov 2, 2005
Messages
439
Office Version
  1. 365
Platform
  1. Windows
I'm trying to set up a warning when a something is entered in the [Source] column of myTable, but the cell in the same row in the [Reference] column is left empty.

This works:
Excel Formula:
=IF(
    COUNTA(
        FILTER(myTable[[Source]:[Reference]],(
            (NOT(ISBLANK(myTable[Source])))*
            (ISBLANK(myTable[Reference]))
            )
        )
    )>0,
    "Warning","")

...but is there a better (more efficient) way (without VBA)?
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Would the formula live in a column within the table or outside of the table? If outside of the table maybe you can insert this formula and drag it down.

Excel Formula:
=IF(AND(Table1[@Source]<>"",Table1[@Reference]=""),"Warning","")
 
Upvote 0
Would the formula live in a column within the table or outside of the table? If outside of the table maybe you can insert this formula and drag it down.

Excel Formula:
=IF(AND(Table1[@Source]<>"",Table1[@Reference]=""),"Warning","")
Thanks, I'm looking for something that works in one cell outside the table, rather than a helper column. In the working formula I created the need to filter the whole table before counting it seems to be a bit unwieldy, but maybe it's more efficient than looking in each row.

Maybe even filtering only one column is a bit more efficient, i.e.:

Excel Formula:
=IF(
    COUNTA(
        FILTER(myTable[Source],(
            (NOT(ISBLANK(myTable[Source])))*
            (ISBLANK(myTable[Reference]))
            )
        )
    )>0,
    "Warning","")
 
Upvote 0
I would be surprised if your formula worked, but another option is
Excel Formula:
=IF(COUNTIFS(MyTable[Source],"<>",MyTable[Reference],""),"Warning","")
 
Upvote 1
Solution
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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