Please explain this excel formula

kinkate18nic

New Member
Joined
Aug 9, 2017
Messages
17
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Someone please explain me this formula...what exactly it will do.

=IF(COUNTBLANK(Table1[@[L1-Uber]:[L9-Account Type]]) = 18,2, MIN(Table1[@[L1-Uber]:[L9-Account Type]]))


L1-Uber and L9-Account Type being column names.

Thanks
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hi. I presume there are 18 columns between L1-Uber and L9-Account Type inclusive? If all of those cells in the same row as the formula is housed are blank it will produce a 2. If not it will produce the minimum value in those cells.
 
Upvote 0
Hi. I presume there are 18 columns between L1-Uber and L9-Account Type inclusive? If all of those cells in the same row as the formula is housed are blank it will produce a 2. If not it will produce the minimum value in those cells.


Thanks for the reply.

Actually, there are 35 columns between L1-Uber and L9-Account. If I make the complete row blank, the result comes as 0. If i change any cell value to 0 then the formula gives 0 which seems to be correct. But, it is the rest of the formula I am not understanding i.e 18,2, what does it accomplish?
 
Upvote 0
there are 35 columns between L1-Uber and L9-Account.
....
what does it accomplish?

Apparently nothing.

Best guess is that at the time the formula was written, there were only 18 columns between Uber and Account.
Therefore it 'was' testing if ALL columns are blank, then return 2, otherwise give the minimum value.

So maybe you need to update the formula by changing 18 to 35
 
Upvote 0
Or perhaps instead of needing to count the columns and hard code that number in the formula.
We can reverse the logic.

Instead of counting blanks, we count NON Blanks.
And if at least 1 cell is NOT blank, then do the MIN, otherwise return 2

=IF(COUNTIF(Table1[@[L1-Uber]:[L9-Account Type]],"<>")>0,MIN(Table1[@[L1-Uber]:[L9-Account Type]]),2)


And counting blanks or non-blanks has always been tricky, given the difference between truely empty cells, and cells containing a formula returning ""
Since the end result is returning the MIN function, which depends on numbers, it's more accurate to count numbers instead of blanks.

=IF(COUNT(Table1[@[L1-Uber]:[L9-Account Type]])>0,MIN(Table1[@[L1-Uber]:[L9-Account Type]]),2)
 
Last edited:
Upvote 0
Thank you for the simplified version. I understood now how the formula is working.
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

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