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

Read excel function give zeros instead of real values

YA_10963798
14-Alexandrite

Read excel function give zeros instead of real values

Hi there

I using (READEXCEL) but it read all the values as zeros 

YA_10963798_0-1729430508634.png

they should be these  values

YA_10963798_1-1729430534960.png

It works with the previous values 

YA_10963798_2-1729430588999.png

thanks in advance

 

 

ACCEPTED SOLUTION

Accepted Solutions
StuartBruff
23-Emerald III
(To:YA_10963798)

Is the Excel worksheet up to date?  You call Sheet 2 in your Mathcad worksheet, but in addition to the lack of Column D, there is no Sheet 2 in "Total Original Location.xlsx".   

 

I modified your Mathcad worksheet to construct the range from the sheet number, column letter and number of lines; I also modified Sheet 1 to include a Column D (scaled copy of Column C).  I didn't see any errors when using Sheet 1 for all valid ranges.  I then changed rang_6 to point to the empty Column E and got a vector of zeros (as expected from an empty column).

 

2024 10 20 D.png

 

Stuart

View solution in original post

11 REPLIES 11
Werner_E
25-Diamond I
(To:YA_10963798)

Missing your Prime file. Hopefully stripped down just showing the reading of the data and the display of the unexpected zeros

Not sure how the pdf you posted should be of any help here.

 

P.S.: Your Excel sheet only contains three columns of data (A,B,C). Hope you did not try to read columns D and E !??

YA_10963798
14-Alexandrite
(To:Werner_E)

Sorry I attached the wrong sheet 

Werner_E
25-Diamond I
(To:YA_10963798)

There is no sheet2 in the Excel file you posted!

As already written before it contains just one sheet with three columns of data (X,Y,Z values) - nothing more.

So trying to read from the second sheet obviously must fail

Werner_E_0-1729443042068.png

 

YA_10963798
14-Alexandrite
(To:Werner_E)

I changed that , however it wasn't saved ... range 4 is in the first excel sheet , but I'm getting zeros in mathcad 

YA_10963798_0-1729444826387.png

also in the one below ... it is writen bad sheet what does that mean? 

 

Werner_E
25-Diamond I
(To:YA_10963798)


@YA_10963798 wrote:

I changed that , however it wasn't saved ... range 4 is in the first excel sheet , but I'm getting zeros in mathcad 

 


Haven't you read what I wrote more than 3 hours ago in my first reply and what I repeated in my last one?

Your Excel sheet contains only three columns of X,Y,Z data - nothing more!. There is no CPT data stored in the file. There is neither a second sheet nor a column D, E or F!!!!

Werner_E_0-1729446122189.png

Or better said, of course there actually are column E and F, but they are empty and contain no data. So Mathcad reads zero values there.

 

YA_10963798
14-Alexandrite
(To:Werner_E)

Hi Werner, 

I read what you wrote and solved the issues in my excel sheet while doing that Stuart wrote another answer.. So I wanted to close the thread so I clicked solved in the last reply. I'm sorry I should have clicked the first reply which came from you. 

 

I really appreciate your help, and time ... You are the hero 

StuartBruff
23-Emerald III
(To:YA_10963798)

Hi Yusra,  I think you're still within the time limit for changing the Solution,  Feel free to select Werner's answer as the Solution.

 

Stuart

StuartBruff
23-Emerald III
(To:YA_10963798)

BTW, if you're interested, here's the rang_n Excel range builder.

 

2024 10 21 B.png

 

This saved me a lot of typing and rechecking ranges when I switched sheets and columns to examine what was happening.

 

Initial Sheet 2 that doesn't exist:

2024 10 21 C.png

 

Change to existing Sheet 1 with data in Column 😧

2024 10 21 D.png

 

Change to Column E that has no data:

2024 10 21 E.png

 

Lots of typing upstream, but far less when changing the ranges.

 

Stuart

 

(Yes, of course I used a program to extract the largest line number to read.  Heaven forbid, I'd be uncouth enough to manually type a 4-digit number (especially when I still have the cost of the Mathcad licence to amortise).  I certainly wasn't going to repeat the tragedy of typing 3147 for the first occurrence of nlines when I could simply have used a program.)

Werner_E
25-Diamond I
(To:YA_10963798)

It does not matter which post you mark as 'solution'  as long as it fits the question.

I was just confused because you sent the Excel file with the missing columns even a second time, so I assumed you did not notice my remark about the file missing the data you tried to access..

StuartBruff
23-Emerald III
(To:YA_10963798)

Is the Excel worksheet up to date?  You call Sheet 2 in your Mathcad worksheet, but in addition to the lack of Column D, there is no Sheet 2 in "Total Original Location.xlsx".   

 

I modified your Mathcad worksheet to construct the range from the sheet number, column letter and number of lines; I also modified Sheet 1 to include a Column D (scaled copy of Column C).  I didn't see any errors when using Sheet 1 for all valid ranges.  I then changed rang_6 to point to the empty Column E and got a vector of zeros (as expected from an empty column).

 

2024 10 20 D.png

 

Stuart

YA_10963798
14-Alexandrite
(To:StuartBruff)

Thank you Stuart

Announcements

Top Tags