Looking for a code or formula what can identify any text and change this into a specific word

sjoerdbosch

New Member
Joined
Mar 27, 2023
Messages
18
Office Version
  1. 365
Platform
  1. Windows
I am looking for a macro or formula what can identify a cell what contains combination of numbers and letters into a word
The combination of letters and numbers is on another sheet than the destination word.
The sheet with the combination is in sheet what is called "Ullage Report" and this is sheet 16 in VBA and the target sheet is "STOWAGE" which is sheet 20 in VBA
The source cells in Ullage - [AF34] - can contain a number - or a number + Letter
If only a number - I want to display in the target cell [STOWAGE N2] the word Annex II and if number(s) + letter it must be Annex I

Had the formula below in the cell in the stowage sheet, and which only works if AF34 is more than 0 but it does not work if the cell contains e.g. 54B
Should that be the case it should display Annex I
=IF('Ullage Report'!P35="","",IF('Ullage Report'!AF34>0,"Annex II","Annex I"))

Also if the cell Ullage Report'!P35="","", [should display nothing]
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Have you any data we can work with
hi. not sure what kind of data i can give you. thought all information needed is in the question
the formula i am looking for should work for any cell which i assign in the formula or code
 
Upvote 0
Try this

=IFS('Ullage Report'!P35="","",ISNUMBER('Ullage Report'!AF34),"Annex II",TRUE,"Annex I")

This is my mock up
Book1.xlsx
BC
254Annex II
354BAnnex I
4412Annex II
5412CAnnex I
Sheet5
Cell Formulas
RangeFormula
C2:C5C2=IF(ISNUMBER(B2),"Annex II","Annex I")
 
Upvote 0
hmm
Try this

=IFS('Ullage Report'!P35="","",ISNUMBER('Ullage Report'!AF34),"Annex II",TRUE,"Annex I")

This is my mock up
Book1.xlsx
BC
254Annex II
354BAnnex I
4412Annex II
5412CAnnex I
Sheet5
Cell Formulas
RangeFormula
C2:C5C2=IF(ISNUMBER(B2),"Annex II","Annex I")
. i get name errors on the formula - most likely because there is a formula in the reference cell - so not empty and also on Annex II statement I get a name error if i remove the first part of the formula.
the mock up - i did not try - can't make sense out of thato_O
 
Upvote 0
I used the IFS function as you have indicated that you are using 365.

Alternative is,
=IF('Ullage Report'!P35="","",IF(ISNUMBER('Ullage Report'!AF34),"Annex II","Annex I"))
 
Upvote 0
Solution
I used the IFS function as you have indicated that you are using 365.

Alternative is,
=IF('Ullage Report'!P35="","",IF(ISNUMBER('Ullage Report'!AF34),"Annex II","Annex I"))
hi
i also use 2016 on other PC's where the program also has to work and that does not have that function
 
Upvote 0
Found a function what does the job. Thanks!

=IF(J13="","",IF(ISNUMBER('Ullage Report'!Q50),"Annex II","Annex I"))
The function and implementation have been provided in post #6, references might change for your needs. Therefore, the marked solution has been switched accordingly.
 
Upvote 0

Forum statistics

Threads
1,223,701
Messages
6,173,920
Members
452,539
Latest member
deeme

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