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.

 

Qui ut velit ut. Officia ullam repellendus aspernatur nihil et praesentium voluptatem. Mollitia qui esse consequatur tempora libero. Sed minima expedita molestias quas velit.

Career Advancement Opportunities

November 2026 Investment Banking

  • Evercore 01 99.5%
  • Moelis & Company 01 99.0%
  • JPMorgan 01 98.4%
  • Guggenheim Partners 02 97.9%
  • Morgan Stanley 06 97.4%

Overall Employee Satisfaction

November 2026 Investment Banking

  • Moelis & Company No 99.5%
  • Morgan Stanley 02 99.0%
  • Evercore 01 98.4%
  • Banco Santander 04 97.9%
  • BMO Capital Markets 13 97.4%

Professional Growth Opportunities

November 2026 Investment Banking

  • Evercore 01 99.5%
  • Moelis & Company 01 99.0%
  • Morgan Stanley 05 98.4%
  • Goldman Sachs 01 97.9%
  • JPMorgan No 97.4%

Total Avg Compensation

November 2026 Investment Banking

  • Vice President (17) $409
  • Associates (58) $261
  • 3rd+ Year Analyst (8) $210
  • 2nd Year Analyst (29) $183
  • Intern/Summer Associate (16) $161
  • 1st Year Analyst (84) $151
  • Intern/Summer Analyst (77) $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
Secyh62's picture
Secyh62
99.0
3
kanon's picture
kanon
99.0
4
BankonBanking's picture
BankonBanking
99.0
5
Betsy Massar's picture
Betsy Massar
98.9
6
GameTheory's picture
GameTheory
98.9
7
DrApeman's picture
DrApeman
98.9
8
dosk17's picture
dosk17
98.9
9
CompBanker's picture
CompBanker
98.9
10
Mimbs's picture
Mimbs
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...”