IF statement/formula help across multiple columns :-)

Yecart77

New Member
Joined
Nov 8, 2022
Messages
18
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
Platform
  1. Windows
Hello Excel Experts,
Needing some guidance on how to go about an if statement/formula for this scenario. I'm not sure if an IF statement is the best way or if there is a better way to do it in excel.
This is part of an accounting general journal generator I am building to automate corrections that can uploaded into financial system as the journal description.
In the screenshot below:
Cells A1:E1 have the elements that will be corrected such as General Ledger Code, Profit Centre, etc expressed as AAA, BBB,etc for simplicity.
Cells A2:E6 contain numerical values, expressed as an x, again for simplicity. If that element is correct the cell will be blank.
Cells C2:C6 contain the comments I want the formula to return.
E.g. Row 3 has an error in Element AAA and CCC, so I would like the formula to return the text 'Correct-AAA-CCC' in F3.
I hope I have explained that with clarity. Any insights on where to start are much appreciated.
Cheers,
Tracey
 

Attachments

  • ExcelSample.jpg
    ExcelSample.jpg
    39.2 KB · Views: 8

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
as you have later versions of Excel - 365
how about using text join

I suspect it can be done as a full array - and not require copying down, but this is my first take ,

Book4
ABCDEF
1AAABBBCCCDDDEEEJournal Output
2 
3xCorrect - AAA
4 
5xxCorrect - AAA - CCC
6xxxxCorrect - AAA - BBB - CCC - DDD
Sheet1
Cell Formulas
RangeFormula
F2:F6F2=IF(COUNTA(A2:E2),"Correct - "&TEXTJOIN(" - ",,IF(A2:E2="X",$A$1:$E$1,"")),"")
 
Upvote 0
Hi Etaf,
Thank you so much, that works perfectly in 365. Could I please trouble you for what I would use in Excel 2016 where TEXTJOIN isn't available. I played around with CONCAT but could get the hypen as a separator in the same place e.g. Correct-AAA-BBB. Cheers, Tracey
 
Upvote 0
sorry, i dont know off the top of my head, i will try and research , long time since i have used 2016 , also not sure i ever needed to do this sort of thing
hopefully some other member will see the thread and know
 
Upvote 0
How about
Excel Formula:
=IF(COUNTA(A2:E2),"Correct"&IF(A2="x"," - "&$A$1,"")&IF(B2="x"," - "&$B$1,"")&IF(C2="x"," - "&$C$1,"")&IF(D2="x"," - "&$D$1,"")&IF(E2="x"," - "&$E$1,""),"")
 
Upvote 0

Forum statistics

Threads
1,214,780
Messages
6,121,522
Members
449,037
Latest member
tmmotairi

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