default_name
Board Regular
- Joined
- May 16, 2018
- Messages
- 180
- Office Version
- 365
- 2016
- Platform
- Windows
- MacOS
I have a table of information.
Let's call this Table 1.
Table 1[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]Activity
[/TD]
[TD="align: center"]TNumber
[/TD]
[TD="align: center"]ID
[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD]Training[/TD]
[TD="align: center"][/TD]
[TD="align: center"]54465[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD]Exercise A[/TD]
[TD="align: center"]ABC111A[/TD]
[TD="align: center"]91299[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD]Exercise B[/TD]
[TD="align: center"]ABC222B[/TD]
[TD="align: center"]91300[/TD]
[/TR]
</tbody>[/TABLE]
This second table (let's call this Table 2) allows the user to select an Activity from a dropdown list (which has been created for column F).
The corresponding TNumber and ID numbers are filled in from the first table.
Table 2
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]Activity
[/TD]
[TD="align: center"]TNumber
[/TD]
[TD="align: center"]ID
[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD]Exercise B[/TD]
[TD="align: center"]ABC22B[/TD]
[TD="align: center"]91300[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
It appears to be working great in instances where an Activity has a TNumber and an ID number.
However, in Activity cases (such as Training) where there is no TNumber (only an ID number), I want the corresponding cell in the Table 2 to display a dash/hyphen (as below in cell G3).
Table 2[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]Activity
[/TD]
[TD="align: center"]TNumber
[/TD]
[TD="align: center"]ID
[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD]Exercise B[/TD]
[TD="align: center"]ABC22B[/TD]
[TD="align: center"]91300[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD]Training[/TD]
[TD="align: center"]-[/TD]
[TD="align: center"]54465[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
I figured that I could simply add an ISBLANK function with a conditional (IF) into the VLOOKUP function, but that doesn't seem to be working.
Here is how I have the TNumber cell coded (using the code inside G3 as an example).
for the TNumber
for the ID number
How can I make this work the way I am envisioning it?
Hope that makes sense.
Thanks in advance.
Let's call this Table 1.
Table 1[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]Activity
[/TD]
[TD="align: center"]TNumber
[/TD]
[TD="align: center"]ID
[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD]Training[/TD]
[TD="align: center"][/TD]
[TD="align: center"]54465[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD]Exercise A[/TD]
[TD="align: center"]ABC111A[/TD]
[TD="align: center"]91299[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD]Exercise B[/TD]
[TD="align: center"]ABC222B[/TD]
[TD="align: center"]91300[/TD]
[/TR]
</tbody>[/TABLE]
This second table (let's call this Table 2) allows the user to select an Activity from a dropdown list (which has been created for column F).
The corresponding TNumber and ID numbers are filled in from the first table.
Table 2
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]Activity
[/TD]
[TD="align: center"]TNumber
[/TD]
[TD="align: center"]ID
[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD]Exercise B[/TD]
[TD="align: center"]ABC22B[/TD]
[TD="align: center"]91300[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
It appears to be working great in instances where an Activity has a TNumber and an ID number.
However, in Activity cases (such as Training) where there is no TNumber (only an ID number), I want the corresponding cell in the Table 2 to display a dash/hyphen (as below in cell G3).
Table 2[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]Activity
[/TD]
[TD="align: center"]TNumber
[/TD]
[TD="align: center"]ID
[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD]Exercise B[/TD]
[TD="align: center"]ABC22B[/TD]
[TD="align: center"]91300[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD]Training[/TD]
[TD="align: center"]-[/TD]
[TD="align: center"]54465[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
I figured that I could simply add an ISBLANK function with a conditional (IF) into the VLOOKUP function, but that doesn't seem to be working.
Here is how I have the TNumber cell coded (using the code inside G3 as an example).
Code:
=IF(F3="","",VLOOKUP(F3,$A$2:$C$4,IF(ISBLANK(2),"-",2)))
Code:
=IF(F3="","",VLOOKUP(F3,$A$2:$C$4,IF(ISBLANK(3),"-",3)))
How can I make this work the way I am envisioning it?
Hope that makes sense.
Thanks in advance.