简体   繁体   中英

An “IF” Excel formula that meets criteria of above and below cells

I'm designing a poker training spreadsheet and I've been trying to work out a formula that highlights each row as you progress through the questions with a "-->" arrow.

Here is a screenshot: 在此处输入图片说明

My goal is to insert a "-->" on a row where the previous question has been answered (either "yes" or "no"), but also to instead insert "" if another question in the column is currently highlighted with a "-->" - this way it should smoothly run continuously and no two rows should be highlighted at one time.

The first question was simple enough: I used

=IF(AND(N2="", G3<>"-->"), "-->", "")

I tried to use the following formula on the remaining rows but it didn't work for some reason

=IF(AND(N2="Yes", (COUNTIF(G4:$G$49, "<>"%"-->")>0)), "-->", " ")

This was initially a test to get the functionality working if each answer was correct, which I would then change to 'if the answer is "yes" or "no".

If I got you correctly,

this should do the trick:

=IF(COUNTIF($M$2:$M$20,"<>"&"")+2=ROW(),"-->","")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM