Use a cell value as part of a formula

barberic5

New Member
Joined
Nov 23, 2021
Messages
10
Office Version
  1. 365
Platform
  1. Windows
I am trying to create a formula that uses the value of another cell as an argument in my formula.

This is my current formula:
=IFS([@Item]="","",$B$1="x",Sheet2!$B$2,TRUE,HYPERLINK(SUBSTITUTE(TRIM(SUBSTITUTE("Log In — Leaf Trade"&[@Item],"&","%26"))," ","+"),"Search LeafTrade"))

This is the value in Sheet2!$B$2:
HYPERLINK(SUBSTITUTE(TRIM(SUBSTITUTE("High Mountain Imports"&[@Item],"&","%26"))," ","+"),"Search High Mountain")

My formula won't actually calculate based on the value in Sheet2!$B$2, it just display exactly what i typed in Sheet2!$B$2
Cell Formulas
RangeFormula
H3:H10H3=IFS([@Item]="","",$B$1="x",Sheet2!$B$2,TRUE,HYPERLINK(SUBSTITUTE(TRIM(SUBSTITUTE("https://app.leaf.trade/shop/high-mountain-imports/search.php?search_query="&[@Item],"&","%26"))," ","+"),"Search LeafTrade"))


Zen Leaf Inventory Shopping List 2.xlsx
B
2HYPERLINK(SUBSTITUTE(TRIM(SUBSTITUTE("https://highmountainimports.com/search.php?search_query="&[@Item],"&","%26"))," ","+"),"Search High Mountain")
Sheet2
 
suggest splitting Sheet2!$b$2 formula into two parts ie cells B2 and say C2

1 . SUBSTITUTE(TRIM(SUBSTITUTE("High Mountain Imports"&[@Item],"&","%26"))," ","+")
2 . "Search High Mountain"

Part 1 B2
Excel Formula:
=SUBSTITUTE(TRIM(SUBSTITUTE("https://highmountainimports.com/search.php?search_query="&[@Item],"&","%26"))," ","+")

Part2 C2
Excel Formula:
Search High Mountain

and Modify your ifs formula by replacing Sheet2!$B$2 with HYPERLINK(Sheet2!$B$2,Sheet2!$C$2)

Excel Formula:
=IFS([@Item]="","",$B$1="x",HYPERLINK(Sheet2!$B$2,Sheet2!$C$2),TRUE,HYPERLINK(SUBSTITUTE(TRIM(SUBSTITUTE("https://app.leaf.trade/shop/high-mountain-imports/search.php?search_query="&[@Item],"&","%26"))," ","+"),"Search LeafTrade"))
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
suggest splitting Sheet2!$b$2 formula into two parts ie cells B2 and say C2

1 . SUBSTITUTE(TRIM(SUBSTITUTE("High Mountain Imports"&[@Item],"&","%26"))," ","+")
2 . "Search High Mountain"

Part 1 B2
Excel Formula:
=SUBSTITUTE(TRIM(SUBSTITUTE("https://highmountainimports.com/search.php?search_query="&[@Item],"&","%26"))," ","+")

Part2 C2
Excel Formula:
Search High Mountain

and Modify your ifs formula by replacing Sheet2!$B$2 with HYPERLINK(Sheet2!$B$2,Sheet2!$C$2)

Excel Formula:
=IFS([@Item]="","",$B$1="x",HYPERLINK(Sheet2!$B$2,Sheet2!$C$2),TRUE,HYPERLINK(SUBSTITUTE(TRIM(SUBSTITUTE("https://app.leaf.trade/shop/high-mountain-imports/search.php?search_query="&[@Item],"&","%26"))," ","+"),"Search LeafTrade"))
This doesn't work because Part 1 of your suggestion uses [@Item] in the formula which references a column in the table on Sheet1.

I need the formula in Sheet1 to conduct a search of a Product Name on the respective wholesalers website. Therefore the search URL will be different for every product in Sheet1 depending on the selected Wholesaler. The search URL will also be different for each product, since every row in the Sheet1 table will be a different product. It uses [@Item] (the Product Name), to search that product on the respective wholesalers website. So when I use try Part 1 of your suggestion, it does not work because it includes [@Item], which references the Product Name in Sheet1.

Sorry if that's confusing, I'm not good at articulating this. Let me know if I need to explain this better.
 
Upvote 0
Here is a link to the spreadsheet if that helps
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,434
Members
448,961
Latest member
nzskater

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