Does anyone know how to fix this Excel UDF?

I have an excel UDF that is basically a series of if statements. The problem is that there can be multiple true statements and I want Excel to extract the "value if true" figure from the first if statement it finds true. However, right now, Excel is defaulting to the last if statement it sees as true (the last statement before End Function).

Any way to change this?

SB to the person that solves this!

3 Comments
 

Sending me the code (perhaps in a message) might help me gain a better intuition of the problem. But here's something.

  1. I imagine that you want your code to 'do something' if the first if-statement is true...just copy the part of the code which makes it 'do something' and paste in under that if-statement. Seeing your full code would help me figure out if this is viable.

Most coding languages have an exit/break command but I haven't found one for excel.

 

Pariatur facere quia rerum ad eum ex. Corrupti quo mollitia voluptate perferendis consequatur. Sit omnis ea est iusto occaecati molestiae. Ab eos eum nisi qui. Sit accusantium aut qui et perferendis quos. In similique voluptas ratione et sapiente.

Maxime et ducimus ratione nihil corporis qui laboriosam. Velit culpa deserunt rerum sint. Quo nostrum ut laboriosam sint provident ipsa ex.

Career Advancement Opportunities

June 2026 Investment Banking

  • Evercore 01 99.4%
  • Moelis & Company 01 98.8%
  • JPMorgan 01 98.2%
  • Guggenheim Partners 01 97.7%
  • Morgan Stanley 07 97.1%

Overall Employee Satisfaction

June 2026 Investment Banking

  • Moelis & Company No 99.4%
  • Morgan Stanley 02 98.8%
  • Evercore 01 98.2%
  • BMO Capital Markets 12 97.6%
  • Banco Santander 01 97.1%

Professional Growth Opportunities

June 2026 Investment Banking

  • Moelis & Company No 99.4%
  • Evercore No 98.8%
  • Morgan Stanley 05 98.2%
  • JPMorgan No 97.7%
  • BMO Capital Markets 12 97.1%

Total Avg Compensation

June 2026 Investment Banking

  • Vice President (14) $434
  • Associates (43) $259
  • 3rd+ Year Analyst (8) $210
  • 2nd Year Analyst (22) $179
  • Intern/Summer Associate (13) $156
  • 1st Year Analyst (75) $151
  • Intern/Summer Analyst (68) $101
notes
16 IB Interviews Notes

“... there’s no excuse to not take advantage of the resources out there available to you. Best value for your $ are the...”

Leaderboard

1
redever's picture
redever
99.2
2
kanon's picture
kanon
99.0
3
Secyh62's picture
Secyh62
99.0
4
BankonBanking's picture
BankonBanking
99.0
5
dosk17's picture
dosk17
98.9
6
Betsy Massar's picture
Betsy Massar
98.9
7
DrApeman's picture
DrApeman
98.9
8
CompBanker's picture
CompBanker
98.9
9
GameTheory's picture
GameTheory
98.9
10
numi's picture
numi
98.8
success
From 10 rejections to 1 dream investment banking internship

“... I believe it was the single biggest reason why I ended up with an offer...”