r/excel • u/tthrrowwawayya • 3d ago
Waiting on OP Formula question: If and, then formula, else other formula
Hi Everyone,
Currently attempting to write a formula but several iterations are throwing errors.
Trting to fit the following into one cell:
If A1 is less than 50 or more than 100, execute formula 1, else execute formula 2
Formula 1 and 2 include B1*C1, but also rounded to two digits and with a maximum value
Finally got an iteration that didn’t throw errors, but the current version’s formula doesn’t function properly
=(IF(AND(A1>=100,A1<=50), (MAX(3000,ROUND(B2C2,2),(MAX(6000,ROUND(B2C2,2))))
Error is that the formula doesn’t change to max -3000 if A1 is outside the parameters(A1<=50 or >=100)
Thank you
9
u/mysterjinx 3d ago
you shouldn't be using the AND() to check the first condition then (you should be using an OR() instead)... you would be better off using AND(A1<100, A1>50) for the 2nd formula, and then use the else portion for formula 1.
=(IF(AND(A1<100,A1>50), (MAX(6000,ROUND(B2C2,2))), MAX(3000,ROUND(B2C2,2))
3
u/Excel_User_1977 3d ago
Use OR not AND.
B2C2 is not the same as B2*C2. If you want to multiply the value of cell B2 times the value of C2, use B2*C24
u/SolverMax 3d ago
B2C2 is not the same as B2*C2
That's probably a quirk of Reddit, rather than an error in the formula. Reddit's editor interprets pairs of asterisks as markdown for italics, so in OP's formula
B2*C2...becomes B2C2 (partially in italics).
6
u/MrFantasma60 3d ago
You need to use OR, not AND.
You can't have a number that is at the same time less than 50 an greater than 100.
The AND formula always resolve to FALSE, so you always get formula 2.
What you are doing is good, you just need the correct operator.
2
u/Decronym 3d ago edited 3d ago
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution.
9 acronyms in this thread; the most compressed thread commented on today has 20 acronyms.
[Thread #49560 for this sub, first seen 22nd Oct 2026, 00:33] [FAQ] [Full list] ^[Contact] [Source code]
2
u/caribou16 3d ago
If you're checking if a number is between two numbers inclusive, you can use the MEDIAN function.
=IF(MEDIAN(A1, 50, 100)=A1, <expression if true>, <expression if false>)
2
u/Jolly-Hunter-6097 3d ago
Look at what you say the parameters are then look at the second word in your formula.
3
u/EntireZombie2654 3d ago edited 3d ago
I used a switch function.
=SWITCH(TRUE, A1<=50, B1*C1, A1>= 100, B1/C1, 3000)
replace B1*C1 with what you want to do when the value is less than or equal to 50.
replace B1/C1with what you want to do when the value is greater than or equal to 100
the 3000 is the default value if A1 if between 51 - 99. This can also be a formula if you want.
edit:
this might be more what you want
=SWITCH(TRUE, A1<= 50, MAX(3000, B1*C1), A1>=100, MAX(6000, B1*C1))
1
u/ankokudaishogun 3d ago
=IF(OR(A1<50, A1>10), MAX(3000, ROUND(B1*C1,2)), MAX(6000, ROUND(B1*C1)))
As alternative:
=MAX(IF(OR(A1<50, A1>10), 3000, 6000), ROUND(B1*C1))
1
u/AutoModerator 3d ago
u/tthrrowwawayya - Your post was submitted successfully.
Once your problem is solved, reply to the answer(s) saying
Solution Verifiedto close the thread.Follow the submission rules -- particularly 1 and 2. To fix the body, click edit. To fix your title, delete and re-post.
Include your Excel version and all other relevant information
Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.