IF AND ELSE formula

LeighMacKay7

New Member
Joined
Oct 11, 2022
Messages
34
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
  2. Web
Hi,
I am hoping somebody can help me, please.

I am not even sure if I am going down the right route in terms of a formula.
I think it is an =IF(AND formula with multiple logic.
I just can't seem to apply the logic.


There are four different types of possibilities, which help me to get the 2022/23 Answer (as shown below)

2021/22 AnswerManual Changes (if required)2022/23 Answer
UT"Blank""Blank"
"Blank"UTUT
"Blank""Blank""Blank"
UTUTUT

If the table says "Blank". Normally it would contain nothing in the cell.

Basically, the Manual Changes (if required) column, overrides what is in the 2021/22 answer, even if it is "Blank". And returns the data in 2022/23 Answer column.

Can anybody point me in the right direction please.

Thanks in advance
Leigh
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
How about
Fluff.xlsm
ABC
12021/22 AnswerManual Changes (if required)2022/23 Answer
2UTUT
3UTUT
4 
5UTUTUT
Data
Cell Formulas
RangeFormula
C2:C5C2=IF(COUNTIFS(A2:B2,"?*")=2,B2,CONCAT(A2:B2))
 
Upvote 0
I am a bit confused/unclear if the grid in the original post is what the OP wants to happen, or if it is what is currently happen.
If it shows what they want to happen, then there is an issue with the formula Fluff provided for row 2 (it appears they want "blank" and not "UT" in that scenario).

If there table in the original post shows the desired outcome, it seems to me that you simply always want what is showing in the second column, does it not?
If so, the formula should just be:
Excel Formula:
=IF(B2="","",B2)
 
Upvote 0
Maybe like this:

Book1
ABC
12021/22 AnswerManual Changes (if required)2022/23 Answer
2UT 
3UTUT
4 
5UTUTUT
Sheet1
Cell Formulas
RangeFormula
C2:C5C2=IF(B2="UT","UT","")
 
Upvote 0
Maybe like this:

Book1
ABC
12021/22 AnswerManual Changes (if required)2022/23 Answer
2UT 
3UTUT
4 
5UTUTUT
Sheet1
Cell Formulas
RangeFormula
C2:C5C2=IF(B2="UT","UT","")
I have tried this one and it doesn't work.
Because where the Change column now needs to be blank. It still pulls through the "UT" text.
Thank you for your reply though. Much appreciated.
 
Upvote 0
I have tried this one and it doesn't work.
Because where the Change column now needs to be blank. It still pulls through the "UT" text.
Thank you for your reply though. Much appreciated.
You received two other replies before that one that you have not addressed.
If neither of those work for you, please try explaining again in more detail, walking us through an example that doesn't work, explaining the logic behind that one.
 
Upvote 0
How about
Fluff.xlsm
ABC
12021/22 AnswerManual Changes (if required)2022/23 Answer
2UTUT
3UTUT
4 
5UTUTUT
Data
Cell Formulas
RangeFormula
C2:C5C2=IF(COUNTIFS(A2:B2,"?*")=2,B2,CONCAT(A2:B2))
Thank you for your time and response to my message.

This one doesn't work either.


As when the answer should be "blank", it still returns the UT text.

I might have to re-think the way in which I am working with the data. And use "0" or "N/A"
 
Upvote 0
Can you post some realistic data showing exactly what you have & explain what the results should be.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
I am a bit confused/unclear if the grid in the original post is what the OP wants to happen, or if it is what is currently happen.
If it shows what they want to happen, then there is an issue with the formula Fluff provided for row 2 (it appears they want "blank" and not "UT" in that scenario).

If there table in the original post shows the desired outcome, it seems to me that you simply always want what is showing in the second column, does it not?
If so, the formula should just be:
Excel Formula:
=IF(B2="","",B2)
1693402822368.png

This one doesn't work either. It just returns "0".

The confusion is that. as shown on my initial message.
If the answer should be an empty cell. But is currently a UT. It returns UT.
 
Upvote 0

Forum statistics

Threads
1,215,124
Messages
6,123,187
Members
449,090
Latest member
bes000

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