cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Automatic range from excel to mathcad

FC_10037391
9-Granite

Automatic range from excel to mathcad

I want to set up prime to read a specific Excel column based on the header of that column? (for example, read the column if the header is name is “Threads”) and see whether the result is less than a specific value or not, add a note, and change its color respectively, would it be possible to atomize that in Mathcad?

FC_10037391_1-1684183369933.png

 

 

 

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:FC_10037391)

Who should do the job? Excel or Prime.

Whoever  should do it has to be able to access the full table to be able to find the column with the desired header text.

If Excel should do the job, you could provide the desired column name as input in the Excel component and use the methods available in Excel to find the desired value and write it in a specific cell which then is returned to Prime.

 

If Prime should do the job, you would have to read in the whole table in a Prime variable and use Primes lookup or match functions to find the appropriate value.

 

Find attached a sheet which shows both methods (both with an embedded Excel component). I found the first one not being reliable as it would not always update correctly.

Personally I would prefer omitting the Excel component and reading in the table from an external sheet via READEXCEL.
But both, component and READEXCEl have their pros and cons. Using READEXCEL you would have to handle two files instead of just one.

 

Werner_E_0-1684274257705.png

 

Attached file is in format Prime 9

View solution in original post

3 REPLIES 3
Werner_E
25-Diamond I
(To:FC_10037391)

Not sure what the first part of your question is all about, but according the color changing text - can't be done in Prime (could be done in real Mathcad using scripted components). This is a feature which was asked for here in the forum a couple of times. The workaround which was offered is to use an Excel component with a text cell the color of which is changed accordingly depending on an input value. You may be able to find that thread using the search function here.

Instead of having using index and designating the value from excel can I just use the heading of the row that needs to be called from excel sheet? 

In here instead of C2F4 can just the heading be called i.e. threads?

Werner_E
25-Diamond I
(To:FC_10037391)

Who should do the job? Excel or Prime.

Whoever  should do it has to be able to access the full table to be able to find the column with the desired header text.

If Excel should do the job, you could provide the desired column name as input in the Excel component and use the methods available in Excel to find the desired value and write it in a specific cell which then is returned to Prime.

 

If Prime should do the job, you would have to read in the whole table in a Prime variable and use Primes lookup or match functions to find the appropriate value.

 

Find attached a sheet which shows both methods (both with an embedded Excel component). I found the first one not being reliable as it would not always update correctly.

Personally I would prefer omitting the Excel component and reading in the table from an external sheet via READEXCEL.
But both, component and READEXCEl have their pros and cons. Using READEXCEL you would have to handle two files instead of just one.

 

Werner_E_0-1684274257705.png

 

Attached file is in format Prime 9

Announcements

Top Tags