A different formula similar to an If statement

FedElecQaEng

New Member
Joined
Sep 25, 2023
Messages
12
Office Version
  1. 2010
Platform
  1. Windows
I make use of the If statement a lot and sometimes the formula returns a 0. When the main formula returns a zero I want it to show the dash character so I usually make a formula like this:

=If(*Formula* = 0,"-",*Formula*)

My main question is if there is a way to not have to repeat the formula twice especially since sometimes the main formula can fill up more than half the formula bar, and sometimes I make changes to the main formula (making the same change twice multiple times can get annoying and time-consuming).


Something I would like is similar to the IFERROR function where, if the formula returns an error then return a different value, else return the formula value (In these cases I also make use of the "-" character)
Following the IFERROR format, a made-up formula that I can imagine as an example would be like =IFVAL([logical formula],[value],[value_if_same]). So if [logical formula] returns the value in [value] then IFVAL returns the [value_if_same] else IFVAL returns the value from [logical formula]
 
Did not know about the LET function, but that looks like it would solve my issue, thank you.

However, people with an older version not being able to use the file is a deal breaker. I am definitely going to make sure I flag this so when the day arrives when my company decides to give everyone the latest version I will definitely use it more. But in the meantime, I can experiment on my home computer since I have 365 there.

Again, thank you
 
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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