Question About Using a Cell Reference Instead of a Number Value in a Formula.

JasmineSilver

New Member
Joined
Mar 18, 2017
Messages
4
Hello all! I'd like to use the formula below but with one modification. Where it says "tritanium=1211562705", I'd like to be able to remove the numbers there and have the formula pull the number from a specific cell.

The formula:

=IMPORTXML("http://api.eve-industry.org/highsec-compression.xml?rate=72.4&tritanium=1211562705", "//eve-industry-api")

Here's what I've tried so far, but get errors every time:

tritanium="C22""
tritanium="C22"
tritanium=INDIRECT"C22"
tritanium=INDIRECT"C22""
tritanium=(INDIRECT"C22")")
tritanium==(INDIRECT"C22")"

and so on and so forth. I'm very new to spreadsheeting, so I'm still learning. I'm using Google Sheets btw, because so far I haven't been able to get this and other similar scripts and formulas to work in Excel.

So, does anyone know how I can reference a cell there instead of manually inputting a number?

Thank you very much for your help!
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Try
=IMPORTXML("http://api.eve-industry.org/highsec-compression.xml?rate=72.4&tritanium=" & C22, "//eve-industry-api")

You need the & to concatenate "http://api.eve-industry.org/highsec-compression.xml?rate=72.4&tritanium=" with the string in C22
 
Last edited:
Upvote 0
Awesome, that worked! Thank you! But if I may trouble you further, please. The formula gets a bit more complicated, so here is what I'm trying to do:

=IMPORTXML("http://api.eve-industry.org/highsec-compression.xml?rate=72.4&tritanium=1211562705&pyerite=211562705&mexallon=77320113&isogen=12421454&nocxium=3527304", "//eve-industry-api")


I want to replace the numbers that I bold/underlined each with different cells. I tried applying the formula you provided me in your previous reply to this formula, but I guess I'm not getting it right. So for example, I want the first number to be C22, next D22, E22, etc.
 
Upvote 0
forget about the IMPORTXML part for the moment.

You are looking for a way to get the string.

"http://api.eve-industry.org/highsec-compression.xml?rate=72.4&tritanium=1211562705&pyerite=211562705&mexallon=77320113&isogen=12421454&nocxium=3527304"

If you have 3527304 in G22, the formula
="http://api.eve-industry.org/highsec-compression.xml?rate=72.4&tritanium=1211562705&pyerite=211562705&mexallon=77320113&isogen=12421454&nocxium=" & G22 will return the desired string.

If you also have 12421454 in F22, the formula
="http://api.eve-industry.org/highsec-compression.xml?rate=72.4&tritanium=1211562705&pyerite=211562705&mexallon=77320113&isogen=" & F22 & "&nocxium=" & G22

etc. etc.

Its just a matter of building the string that you want, and then using that formula as the first argument of the IMPORTXLM function
 
Upvote 0

Forum statistics

Threads
1,222,790
Messages
6,168,258
Members
452,173
Latest member
heinojt

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