Forum

Notifications
Clear all

Assistance needed with formula that should ignore hidden cells

15 Posts
4 Users
0 Reactions
110 Views
(@Anonymous)
Posts: 0
New Member Guest
 

I have the following formula in column F of my attached Excel file.

=IF([@Override]="Yes", "Yes", IF([@Override]="No", "No", IFERROR(IF(AND([@Supplier]<>"", [@[Comparative Price]]<>"", [@[Comparative Price]]=AGGREGATE(15,6,[Comparative Price]/(([Line No]=[@[Line No]])*[Auxiliary]),1)), "Yes", "No"), "No")))

Check the attached file for an explanation of my issue.

Thank you for your assistance.

 
Posted : 11/12/2023 9:04 am
(@Anonymous)
Posts: 0
New Member Guest
 

The 2 files I uploaded previously should be ignored. Use the new one attached.

 
Posted : 11/12/2023 9:49 am
(@keebellah)
Posts: 373
Reputable Member
 

Both these files are identical (?) at least by name?

And further more, your topic question is an=bout 'ignore HIDDEN cells' but ... there are no hidden cells

Which version of Excel?

 
Posted : 12/12/2023 3:11 am
(@keebellah)
Posts: 373
Reputable Member
 

The rows are hidden when you use the splicer, now I see it but your formula to check Yes/No in F, isn't it much easier to to first add datavalidation to column E so that only Yes/No can be entered?

After thatm why all the complication. if E=Yes the F= No ?

 
Posted : 12/12/2023 3:26 am
(@Anonymous)
Posts: 0
New Member Guest
 

Hi Hans, in case you missed my previous post, the correct file is attached.

I'll explain further; in my live application, column E contains data validation so that  only Yes or No can be selected.

The purpose of column F is to find the Lowest value for the relevant Line No for visible rows.

If you filter out Supplier "Ziggy" the results are correct. But if you make "Ziggy" visible, you'll note that in the column E for "Ziggy" the cell values are "Yes". This means Override the Lowest value found in column F. But now in column F, the Lowest value still shows "Yes" and "Ziggy" also "Yes". This is the issue as only "Ziggy" should show "Yes".

 

I hope the above makes sense. 

 
Posted : 12/12/2023 4:17 am
Riny van Eekelen
(@riny)
Posts: 1185
Member Moderator
 

The formula in F seems to return Yes for the smallest value in each group of visible line numbers where certain other cells are not empty. The formula does exactly that in F11. If that's not correct you need to rewrite the formula.

And the reason for F14 to return Yes is because the very first IF checks if Override = Yes, then Yes. The formula stops evaluating and does not care if the rows are visible or not.

In short, I don't really understand what you are trying to achieve. some more clarification is needed.

 
Posted : 12/12/2023 4:52 am
(@Anonymous)
Posts: 0
New Member Guest
 

Riny, thanks for responding.

Let me explain a bit more. "The formula in F seems to return Yes for the smallest value in each group of visible line numbers where certain other cells are not empty. " Totally correct, however, if there is Yes in column E  (and there will only be 1 per group) for a visible row, the formula in F should return Yes for that row and ignore finding the smallest value. Furthermore, if the row that contains Yes in column E gets filtered out (hidden), then the formula in F should work as normal, that is, finding the smallest value.

I hope my explanation makes sense.

 
Posted : 12/12/2023 6:00 am
Riny van Eekelen
(@riny)
Posts: 1185
Member Moderator
 

Working on it. I'll be back!    

 
Posted : 12/12/2023 6:22 am
Riny van Eekelen
(@riny)
Posts: 1185
Member Moderator
 

I took the liberty to add some more helper columns (shaded orange) to make it easier to follow (mostly for myself). and I also changed the logic of determining what's visible and what is not. See if the Result column is what you need.

 
Posted : 12/12/2023 7:01 am
(@Anonymous)
Posts: 0
New Member Guest
 

Hi Riny, fantastic it works in that Result column. It would be nice if the same could be achieved without the additional helper columns Is that possible?

Thank you very much for the help you have provided so far.

 
Posted : 12/12/2023 7:24 am
Riny van Eekelen
(@riny)
Posts: 1185
Member Moderator
 

Sure, but the formula will become quite long and ugly. Which Excel version do you use?    

 
Posted : 12/12/2023 7:52 am
(@Anonymous)
Posts: 0
New Member Guest
 

Hi Riny, I'm using Excel 365.

Thanks once again for this brilliant solution.

Just for interest, we used VBA up to now to achieve the results that you did with formulas. The performance using formulas is much better than using VBALaugh.

 
Posted : 12/12/2023 8:14 am
Riny van Eekelen
(@riny)
Posts: 1185
Member Moderator
 

Good to hear. Not a big fan of VBA anyway.     

 
Posted : 12/12/2023 9:29 am
(@keebellah)
Posts: 373
Reputable Member
 

Grat solution, and Riny, you say you're not a big fan of VBA, this, seen the newest developments and functionality which Microsoft is building in I agree and I am using it more often too but there are so many pre 365 - 2021 users that VBA is in manycases the best soltuion and well written doesn't have to be a setback unless limited by the user's netwoks

 
Posted : 13/12/2023 3:08 am
(@debaser)
Posts: 836
Member Moderator
 

For your original data set with the Auxiliary column in place, perhaps:

=IF([@Override]="Yes","Yes",IF(OR([@Supplier]="",[@[Comparative Price]]=""),"No",IF(COUNTIFS([Line No],[@[Line No]],[Auxiliary],1,[Override],"Yes"),"No",IF(MIN(FILTER([Comparative Price],([Line No]=[@[Line No]])*([Auxiliary]=1)))=[@[Comparative Price]],"Yes","No"))))

 
Posted : 15/12/2023 6:47 am
Share: