use function OR more than 5 logic numbers for 2 result

Osama Fawzy

New Member
Joined
Aug 24, 2022
Messages
39
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
  2. Mobile
Hi, i have a table consists of (5) column (A,B,C,D,E), the column E(TTSN) has more than 7 logic number from column A (Serial Number), and i want to chose from just 2 choice, but the formula IF(OR(A7="A9197",A7="A8538",A7="43815",A7="43637",A7="43236",A7="43059",A7="14138",A7="17644",A7="14216") stop at the second number

Serial-NumberDateTSNCSNTLBTTSN
A919705-11-2021163978299000249=IFERROR(IF(OR(A7="A9197",A7="A8538",A7="43815",A7="43637",A7="43236",A7="43059",A7="14138",A7="17644",A7="14216"),VLOOKUP(H7,OSAMA\1-Aircraft''s Status\3-SU-NMG\[SU-NMG_2022.xlsb]AC TLB'!$A$7:$E$1199,5,1)-F7/24,VLOOKUP(H7,OSAMA\3-SU-NMG\[SU-NMG_2022.xlsb]AC TLB'!$A$7:$E$1199,5,1)),"")
A853812-06-2022177228328000250
4381522-11-20212095211609000260
4363715-11-20212420113170000270
4323622-11-20212313512400000350
4305916-11-20212295912141000370
1413812-08-20202360212214000420
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
can you give an example of what you want to choose 2 from the more than 7

you could add the numbers into a table and then use count()

=IF( AND(Count(Table to lookup, value 1 ) >0, Count(Table to lookup, value 2 ) >0), vlookup1,vlookup2

But not sure i follow exactly what you are after
has more than 7 logic number from column A (Serial Number), and i want to chose from just 2 choice,
 
Upvote 0
can you give an example of what you want to choose 2 from the more than 7

you could add the numbers into a table and then use count()

=IF( AND(Count(Table to lookup, value 1 ) >0, Count(Table to lookup, value 2 ) >0), vlookup1,vlookup2

But not sure i follow exactly what you are after
thanks for u, the function "OR" has (9) logic numbers (A7="A9197",A7="A8538",A7="43815",A7="43637",A7="43236",A7="43059",A7="14138",A7="17644",A7="14216"), and tow choice VLOOKUP(H7,OSAMA\1-Aircraft''s Status\3-SU-NMG\[SU-NMG_2022.xlsb]AC TLB'!$A$7:$E$1199,5,1)-F7/24,VLOOKUP(H7,OSAMA\3-SU-NMG\[SU-NMG_2022.xlsb]AC TLB'!$A$7:$E$1199,5,1), so the formula stop at logic number 2 (A7="8538"), i want the formula test all of (9) numbers and if one of them is true Implement first chose (VLOOKUP(H7,OSAMA\1-Aircraft''s Status\3-SU-NMG\[SU-NMG_2022.xlsb]AC TLB'!$A$7:$E$1199,5,1)-F7/24) and if no one of (9) numbers implement the second chose (VLOOKUP(H7,OSAMA\3-SU-NMG\[SU-NMG_2022.xlsb]AC TLB'!$A$7:$E$1199,5,1), so the formula stop at logic number 2 (A7="8538")
 
Upvote 0
=IF(OR(A7="A9197",A7="A8538",A7="43815",A7="43637",A7="43236",A7="43059",A7="14138",A7="17644",A7="14216"),VLOOKUP(H7,OSAMA\1-Aircraft''s Status\3-SU-NMG\[SU-NMG_2022.xlsb]AC TLB'!$A$7:$E$1199,5,1)-F7/24,VLOOKUP(H7,OSAMA\3-SU-NMG\[SU-NMG_2022.xlsb]AC TLB'!$A$7:$E$1199,5,1))
that should work OK
BUT - you have a mixture of Number and Text - that maybe be the issue

"14138" is text and so will not see the number 14138
so if the spreadsheet has those as numbers
then try
=OR(A7="A9197",A7="A8538",A7=43815,A7=43637,A7=43236,A7=43059,A7=14138,A7=17644,A7=14216)

now its looking for the number

=OR(A7="A9197",A7="A8538",A7="43815",A7="43637",A7="43236",A7="43059",A7="14138",A7="17644",A7="14216")
will give a TRUE when it finds any of those as TEXT only
so using
IF( TEST , do if TRUE, do if No Match FALSE)

Book2
ABCDE
1
2
3
4
5
6
7A8538TRUE
843637a numberFALSE
943637textTRUE
10FALSE
11
12
1343637numberTRUE
14A8538textTRUE
15
Sheet1
Cell Formulas
RangeFormula
E7:E10E7=OR(A7="A9197",A7="A8538",A7="43815",A7="43637",A7="43236",A7="43059",A7="14138",A7="17644",A7="14216")
E13:E14E13=OR(A7="A9197",A7="A8538",A7=43815,A7=43637,A7=43236,A7=43059,A7=14138,A7=17644,A7=14216)
 
Upvote 0
Solution
=IF(OR(A7="A9197",A7="A8538",A7="43815",A7="43637",A7="43236",A7="43059",A7="14138",A7="17644",A7="14216"),VLOOKUP(H7,OSAMA\1-Aircraft''s Status\3-SU-NMG\[SU-NMG_2022.xlsb]AC TLB'!$A$7:$E$1199,5,1)-F7/24,VLOOKUP(H7,OSAMA\3-SU-NMG\[SU-NMG_2022.xlsb]AC TLB'!$A$7:$E$1199,5,1))
that should work OK
BUT - you have a mixture of Number and Text - that maybe be the issue

"14138" is text and so will not see the number 14138
so if the spreadsheet has those as numbers
then try
=OR(A7="A9197",A7="A8538",A7=43815,A7=43637,A7=43236,A7=43059,A7=14138,A7=17644,A7=14216)

now its looking for the number

=OR(A7="A9197",A7="A8538",A7="43815",A7="43637",A7="43236",A7="43059",A7="14138",A7="17644",A7="14216")
will give a TRUE when it finds any of those as TEXT only
so using
IF( TEST , do if TRUE, do if No Match FALSE)

Book2
ABCDE
1
2
3
4
5
6
7A8538TRUE
843637a numberFALSE
943637textTRUE
10FALSE
11
12
1343637numberTRUE
14A8538textTRUE
15
Sheet1
Cell Formulas
RangeFormula
E7:E10E7=OR(A7="A9197",A7="A8538",A7="43815",A7="43637",A7="43236",A7="43059",A7="14138",A7="17644",A7="14216")
E13:E14E13=OR(A7="A9197",A7="A8538",A7=43815,A7=43637,A7=43236,A7=43059,A7=14138,A7=17644,A7=14216)
thanks a lot
 
Upvote 0
was it the text / number issue ?
 
Upvote 0

Forum statistics

Threads
1,214,608
Messages
6,120,500
Members
448,968
Latest member
screechyboy79

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